|
83 | 83 | """
|
84 | 84 |
|
85 | 85 |
|
| 86 | +epilog_properties = \ |
| 87 | +""" |
| 88 | +Print properties of given package. |
| 89 | +
|
| 90 | +EXAMPLE: |
| 91 | +
|
| 92 | + $ sage --package properties maxima |
| 93 | + maxima: |
| 94 | + path: /.../build/pkgs/maxima |
| 95 | + version_with_patchlevel: 5.46.0 |
| 96 | + type: standard |
| 97 | + source: normal |
| 98 | + trees: SAGE_LOCAL |
| 99 | +""" |
| 100 | + |
| 101 | + |
86 | 102 | epilog_name = \
|
87 | 103 | """
|
88 | 104 | Find the package name given a tarball filename
|
@@ -257,6 +273,19 @@ def make_parser():
|
257 | 273 | '--exclude-dependencies', action='store_true',
|
258 | 274 | help='exclude (ordinary) dependencies of the packages recursively')
|
259 | 275 |
|
| 276 | + parser_properties = subparsers.add_parser( |
| 277 | + 'properties', epilog=epilog_properties, |
| 278 | + formatter_class=argparse.RawDescriptionHelpFormatter, |
| 279 | + help='Print properties of given packages') |
| 280 | + parser_properties.add_argument( |
| 281 | + 'package_class', metavar='[package_name|:package_type:]', |
| 282 | + type=str, nargs='+', |
| 283 | + help=('package name or designator for all packages of a given type ' |
| 284 | + '(one of :all:, :standard:, :optional:, and :experimental:)')) |
| 285 | + parser_properties.add_argument( |
| 286 | + '--format', type=str, default='plain', |
| 287 | + help='output format (one of plain and shell; default: plain)') |
| 288 | + |
260 | 289 | parser_name = subparsers.add_parser(
|
261 | 290 | 'name', epilog=epilog_name,
|
262 | 291 | formatter_class=argparse.RawDescriptionHelpFormatter,
|
@@ -404,6 +433,8 @@ def run():
|
404 | 433 | exclude=args.exclude,
|
405 | 434 | include_dependencies=args.include_dependencies,
|
406 | 435 | exclude_dependencies=args.exclude_dependencies)
|
| 436 | + elif args.subcommand == 'properties': |
| 437 | + app.properties(*args.package_class, format=args.format) |
407 | 438 | elif args.subcommand == 'name':
|
408 | 439 | app.name(args.tarball_filename)
|
409 | 440 | elif args.subcommand == 'tarball':
|
|
0 commit comments