neshtea / kimai_report

Utilities to generate reports for company contorlling
1 stars 2 forks source link

Simplifying command line arguments by persisting API parameters? #7

Open kenranunderscore opened 2 days ago

kenranunderscore commented 2 days ago

In order to more easily interact with the multiple commands, would it be possible to have something like loading API information (endpoint, user, password) from a configuration file? Could be something "global", like in $XDG_CONFIG_HOME, or something we have to point to with a separate command line argument?

Disregarding the password and just talking about endpoint + user being specified "somewhere", this could also simplify the command line in general, as these parameters have to be passed to every subcommand right now. I'm open to brainstorm about this of course :grinning:

neshtea commented 2 days ago

Good idea. I see two options going forward (maybe we should do both)

  1. put the positional arguments that stay the same for all subcommands before the subcomment
  2. give the user the option to point to a config file

I would, however, not read the password from a config file but like the idea of providing the option to read the password from stdin.