Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli rework #220

Closed
jkowalleck opened this issue Mar 24, 2020 · 2 comments
Closed

cli rework #220

jkowalleck opened this issue Mar 24, 2020 · 2 comments
Assignees
Milestone

Comments

@jkowalleck
Copy link
Member

current CLI works like nichtparasoup [options] subcommand [subcommand-options]
e.g.: nichtparasoup config --dump _tmp/np.yaml

the issue is, that most subcommand-options are actually sub-subcommands.
e.g. nichtparasoup config dump _tmp/np.yaml

goal:

  • all options being real options, not (sub-)subcommands.
  • options that trigger a sub-subcommand are such sub-commands

this will be a breaking change.
ut this should be no problem, since version 2.5.0 is going to bring breaking CLI changes, anyways.

@jkowalleck jkowalleck self-assigned this Mar 24, 2020
@jkowalleck jkowalleck added this to the 3.0.0 milestone Mar 26, 2020
@jkowalleck
Copy link
Member Author

jkowalleck commented Apr 4, 2020

!! work in prograss !!

this is how the cli should look like:

  • command: nichtparasoup
    • optional switch: --version display version and exit
    • subcommand: server
      • subcommand: run
        • optional argument: --config <config file>
          • default: use internal default config
          • completion: existing file .+\.ya?ml
        • optional switch: --debug enable debug output
          • default to false
        • optional switch: --develop enable web-developer-mode
          • default to false
      • subcommand: config
        • subcommand: check
          • argument: <config file>
            • completion: existing file .+\.ya?ml
          • optional switch: --debug enable debug output
            • default to false
          • optional switch: --[no-]probe disble crawler probes
            • default to false
          • optional argument: --probe-retries <retries>
            • default to 3 or a reasonable positive int
          • optional argument: --probe-delay <seconds>
            • default to 0.1 or a reasonable positie float
        • subcommand: dump-defaults
          • argument: <config file> target file
          • optional switch: --overwrite dont ask to overwrite
            • default to false
          • optional switch: --debug enable debug output
            • default to false
    • subcommand: imagecrawler
      • subcommand: list
        • optional switch: --debug enable debug output
          • default to false
      • subcommand: desc
        • argument: <crawler>
          • completion: available crawler names
        • optional switch: --debug enable debug output
          • default to false
      • subcommand: run --- just an idea -- see IDEA: crawlers are callable modules #221
        • optional switch: --debug enable debug output
          • default to false
        • optional argument: --delay <seconds>
          • default to 1 or a reasonable amount
        • optional switch: --auto-reset
          • default to false
        • subcommand: <crawler>
          • completion: available crawler names
          • arguments, options, etc ... are defnied by the imagecrawler
    • subcommand: completion
      • argument: <shell>
        • values: bash, fish, ...

@jkowalleck jkowalleck changed the title cli commands instad of pararams cli rework Apr 4, 2020
@jkowalleck
Copy link
Member Author

IDEAL:

  • put actual commands under nichtparasoup.command.
    and each has its own aimeplementation of __main__ and brings an own arg parser
  • the CLI is under nichtparasoup.cli and has the cli structured arg parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant