jeremyschulman / netcfgbu

Network Configuration Backup
Apache License 2.0
105 stars 15 forks source link

Docs: -C command line option not allowed #81

Closed saparikh closed 4 years ago

saparikh commented 4 years ago

Fresh install of netcfgu via pip and get the following error when trying to specify the path to the toml file:

netcfgbu -C netcfgbu.toml 
Usage: netcfgbu [OPTIONS] COMMAND [ARGS]...
Try 'netcfgbu --help' for help.

Error: no such option: -C

Setup section of the docs: https://github.com/jeremyschulman/netcfgbu#setup indicates this should work.

Help output from cli doesn't say anything about -C option

netcfgbu --help
Usage: netcfgbu [OPTIONS] COMMAND [ARGS]...

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  backup     Backup network configurations.
  inventory  Inventory subcommands.
  login      Verify SSH login to devices.
  probe      Probe device for SSH reachablility.
  vcs        Version Control System subcommands.
saparikh commented 4 years ago

Also, it does not appear to read the netcfgbu.toml in the current working directory by default. I had to set the environment variable NETCFGBU_CONFIG

jeremyschulman commented 4 years ago

The -C option is specified after the subcommand, for example:

$ netcfgbu backup --help
Usage: netcfgbu backup [OPTIONS]

  Backup network configurations.

Options:
  -C, --config FILENAME
  -e, --exclude TEXT           exclude from inventory
  -l, --limit, --include TEXT  limit/include in inventory
  -i, --inventory TEXT         Inventory file-name
  --debug-ssh INTEGER RANGE    enable SSH debugging
  -b, --batch INTEGER RANGE    inevntory record processing batch size
  --help                       Show this message and exit.

The usage would be:

netcfgbu backup -C <filepath> ...
jeremyschulman commented 4 years ago

Closing this issue as I believe I have addressed the question.