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

autonick does not listen for "help" or "-help" args #2050

Closed
doublestrafe opened this issue Mar 26, 2022 · 3 comments · Fixed by DFHack/scripts#360
Closed

autonick does not listen for "help" or "-help" args #2050

doublestrafe opened this issue Mar 26, 2022 · 3 comments · Fixed by DFHack/scripts#360
Assignees
Labels
idea Suggestions, etc.
Projects

Comments

@doublestrafe
Copy link

autonick immediately runs and changes nicknames of all un-nicked dwarves when run with any arguments. This behavior is inconsistent with all other dfhack scripts and utilities, which generally accept "help" or "-help" to give detail about what the command does and how to use it. This leads to new users finding themselves with all their dwarves renamed, with no confirmation, and no way to change them back automatically.

Suggested remediations:

  • Add a confirmation dialog, and a flag to suppress it if someone wants to script autonick
  • Listen for "help" and "-help" and give instructions if they are found
  • Throw an error if autonick does not recognize an argument
@myk002 myk002 added the idea Suggestions, etc. label Mar 26, 2022
@myk002 myk002 added this to To Do in 0.47.05-r5 via automation Mar 26, 2022
@Moth-Tolias
Copy link
Contributor

Moth-Tolias commented Mar 27, 2022

whoops, my bad. will address this tomorrow if i'm able.

@Moth-Tolias
Copy link
Contributor

after a cursory look at some other scripts to see what the best practices might be, a majority seem to ignore -h / -help arguments. drain-aquifer runs destructively without complaint while fillneeds errors with a stack trace, for example. neither display help. i'll continue working on autonick, but it might be worth going through the list of scripts more thoroughly and documenting which ones need the same treatment.

@myk002
Copy link
Member

myk002 commented Mar 28, 2022

Agreed. Here's an example of a script that handles various forms of the "help" parameter and might be a good example to follow: https://github.com/DFHack/scripts/blob/master/prioritize.lua#L534

It handles "-h", "--help", and "help". It might work for "-help" too since that's the same as "-h -e -l -p" and "-h" is the first param that is processed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Suggestions, etc.
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants