Nagstamon icon indicating copy to clipboard operation
Nagstamon copied to clipboard

`nagstamon --help` prints the help of nagstamon-cli, which has completely different invocation than nagstamon gui.

Open ththvseo opened this issue 5 years ago • 2 comments

i was trying to run two nagstamon instances with different configs, and wondering why it was not working... then, by conincidence, i noticed this:

$ nagstamon --config=$HOME/.nagstamon_dev/ 2>&1
An instance is already running this config (/home/user/.nagstamon)

(it's accepting, but apparently ignoring --config! - that might actually be a separate bug)

while --help says:

$ nagstamon --help
usage: nagstamon [-h] [--servername SERVERNAME] [--hostname HOSTNAME]
                 [--comment COMMENT] [--service SERVICE] [--fixed {y,n}]
                 [--start_time START_TIME] [--hours HOURS] [--minutes MINUTES]
                 [--config CONFIG] [--output {y,n}]

[...]
Nagstamon for your CLI
optional arguments:
[...]
  --config CONFIG       Path for configuration folder

the manpage provided in the ubuntu package (might not be yours) states:

nagstamon [alternate-config]

which is correct at least for the gui invocation, but might be missing the cli options.

the code responsible lives here: https://github.com/HenriWahl/Nagstamon/blob/master/nagstamon.py#L35

i would suggest to either:

  • fix nagstamon to support --config also in gui mode, and drop the special handling of the first argument, if a breaking change can be justified
  • handle --help separately outside of cli mode
  • adjust the help text to reflect the single-argument invocation.

if you decide for a solution, i might try to provide a MR with an implementation.

ththvseo avatar Nov 16 '18 14:11 ththvseo

Hi, the CLI feature is not release-ready yet so there is no documentation. Will be in one of the next releases.

Edit: Using a non-default config is right now done by simply giving the path of the config as single argument.

HenriWahl avatar Nov 17 '18 11:11 HenriWahl

Using a non-default config is right now done by simply giving the path of the config as single argument.

sure, but --help suggests something else, which the program then ignores, thus this issue.

ththvseo avatar Nov 19 '18 10:11 ththvseo