[CLI][Added] `--output-name-first` to list outputs by name
- No description See #436
This commit is contained in:
parent
b28ea6d6cd
commit
5d190aee5d
|
|
@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
- `--only-names` to make `--list` list only output names
|
- `--only-names` to make `--list` list only output names
|
||||||
- `--only-pre` to list only the preflights
|
- `--only-pre` to list only the preflights
|
||||||
- `--only-groups` to list only the groups
|
- `--only-groups` to list only the groups
|
||||||
|
- `--output-name-first` to list outputs by name, no description (See #436)
|
||||||
- Global options:
|
- Global options:
|
||||||
- `use_os_env_for_expand` to disable OS environment expansion
|
- `use_os_env_for_expand` to disable OS environment expansion
|
||||||
- `environment`.`extra_os` to define environment variables
|
- `environment`.`extra_os` to define environment variables
|
||||||
|
|
|
||||||
|
|
@ -5672,7 +5672,7 @@ Usage:
|
||||||
[-E DEF] ... [-w LIST] [--banner N] [TARGET...]
|
[-E DEF] ... [-w LIST] [--banner N] [TARGET...]
|
||||||
kibot [-v...] [-b BOARD] [-e SCHEMA] [-c PLOT_CONFIG] [--banner N]
|
kibot [-v...] [-b BOARD] [-e SCHEMA] [-c PLOT_CONFIG] [--banner N]
|
||||||
[-E DEF] ... [--config-outs] [--only-pre|--only-groups] [--only-names]
|
[-E DEF] ... [--config-outs] [--only-pre|--only-groups] [--only-names]
|
||||||
--list
|
[--output-name-first] --list
|
||||||
kibot [-v...] [-c PLOT_CONFIG] [--banner N] [-E DEF] ... [--only-names]
|
kibot [-v...] [-c PLOT_CONFIG] [--banner N] [-E DEF] ... [--only-names]
|
||||||
--list-variants
|
--list-variants
|
||||||
kibot [-v...] [-b BOARD] [-d OUT_DIR] [-p | -P] [--banner N] --example
|
kibot [-v...] [-b BOARD] [-d OUT_DIR] [-p | -P] [--banner N] --example
|
||||||
|
|
@ -5721,6 +5721,7 @@ Options:
|
||||||
also acts as a virtual --only-outputs
|
also acts as a virtual --only-outputs
|
||||||
--only-groups Print only the groups.
|
--only-groups Print only the groups.
|
||||||
--only-pre Print only the preflights
|
--only-pre Print only the preflights
|
||||||
|
--output-name-first Use the output name first when listing
|
||||||
-P, --copy-and-expand As -p but expand the list of layers
|
-P, --copy-and-expand As -p but expand the list of layers
|
||||||
-q, --quiet Remove information logs
|
-q, --quiet Remove information logs
|
||||||
-s PRE, --skip-pre PRE Skip preflights, comma separated or `all`
|
-s PRE, --skip-pre PRE Skip preflights, comma separated or `all`
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ Usage:
|
||||||
[-E DEF] ... [-w LIST] [--banner N] [TARGET...]
|
[-E DEF] ... [-w LIST] [--banner N] [TARGET...]
|
||||||
kibot [-v...] [-b BOARD] [-e SCHEMA] [-c PLOT_CONFIG] [--banner N]
|
kibot [-v...] [-b BOARD] [-e SCHEMA] [-c PLOT_CONFIG] [--banner N]
|
||||||
[-E DEF] ... [--config-outs] [--only-pre|--only-groups] [--only-names]
|
[-E DEF] ... [--config-outs] [--only-pre|--only-groups] [--only-names]
|
||||||
--list
|
[--output-name-first] --list
|
||||||
kibot [-v...] [-c PLOT_CONFIG] [--banner N] [-E DEF] ... [--only-names]
|
kibot [-v...] [-c PLOT_CONFIG] [--banner N] [-E DEF] ... [--only-names]
|
||||||
--list-variants
|
--list-variants
|
||||||
kibot [-v...] [-b BOARD] [-d OUT_DIR] [-p | -P] [--banner N] --example
|
kibot [-v...] [-b BOARD] [-d OUT_DIR] [-p | -P] [--banner N] --example
|
||||||
|
|
@ -62,6 +62,7 @@ Options:
|
||||||
also acts as a virtual --only-outputs
|
also acts as a virtual --only-outputs
|
||||||
--only-groups Print only the groups.
|
--only-groups Print only the groups.
|
||||||
--only-pre Print only the preflights
|
--only-pre Print only the preflights
|
||||||
|
--output-name-first Use the output name first when listing
|
||||||
-P, --copy-and-expand As -p but expand the list of layers
|
-P, --copy-and-expand As -p but expand the list of layers
|
||||||
-q, --quiet Remove information logs
|
-q, --quiet Remove information logs
|
||||||
-s PRE, --skip-pre PRE Skip preflights, comma separated or `all`
|
-s PRE, --skip-pre PRE Skip preflights, comma separated or `all`
|
||||||
|
|
@ -148,7 +149,7 @@ def list_pre_and_outs_names(logger, outputs, do_config, only_pre, only_groups):
|
||||||
logger.info(o.name)
|
logger.info(o.name)
|
||||||
|
|
||||||
|
|
||||||
def list_pre_and_outs(logger, outputs, do_config, only_names, only_pre, only_groups):
|
def list_pre_and_outs(logger, outputs, do_config, only_names, only_pre, only_groups, output_name_first):
|
||||||
if only_names:
|
if only_names:
|
||||||
return list_pre_and_outs_names(logger, outputs, do_config, only_pre, only_groups)
|
return list_pre_and_outs_names(logger, outputs, do_config, only_pre, only_groups)
|
||||||
pf = BasePreFlight.get_in_use_objs()
|
pf = BasePreFlight.get_in_use_objs()
|
||||||
|
|
@ -159,13 +160,17 @@ def list_pre_and_outs(logger, outputs, do_config, only_names, only_pre, only_gro
|
||||||
logger.info('- '+str(c))
|
logger.info('- '+str(c))
|
||||||
logger.info("")
|
logger.info("")
|
||||||
if outputs and not only_pre and not only_groups:
|
if outputs and not only_pre and not only_groups:
|
||||||
logger.info("Available outputs: 'comment/description' (name) [type]")
|
fmt = "name: comment/description [type]" if output_name_first else "'comment/description' (name) [type]"
|
||||||
|
logger.info("Available outputs: format is: `{}`".format(fmt))
|
||||||
for o in outputs:
|
for o in outputs:
|
||||||
# Note: we can't do a `dry` config because some layer and field names can be validated only if we
|
# Note: we can't do a `dry` config because some layer and field names can be validated only if we
|
||||||
# load the schematic and the PCB.
|
# load the schematic and the PCB.
|
||||||
if do_config:
|
if do_config:
|
||||||
config_output(o, dry=False)
|
config_output(o, dry=False)
|
||||||
logger.info('- '+str(o))
|
if output_name_first:
|
||||||
|
logger.info('- {}: {} [{}]'.format(o.name, o.comment, o.type))
|
||||||
|
else:
|
||||||
|
logger.info('- '+str(o))
|
||||||
logger.info("")
|
logger.info("")
|
||||||
if groups and not only_pre:
|
if groups and not only_pre:
|
||||||
logger.info("Available groups:")
|
logger.info("Available groups:")
|
||||||
|
|
@ -499,7 +504,8 @@ def main():
|
||||||
|
|
||||||
# Is just "list the available targets"?
|
# Is just "list the available targets"?
|
||||||
if args.list:
|
if args.list:
|
||||||
list_pre_and_outs(logger, outputs, args.config_outs, args.only_names, args.only_pre, args.only_groups)
|
list_pre_and_outs(logger, outputs, args.config_outs, args.only_names, args.only_pre, args.only_groups,
|
||||||
|
args.output_name_first)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
if args.list_variants:
|
if args.list_variants:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue