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

Switch binaries to use posix flags #7052

Closed
wants to merge 1 commit into from

Conversation

jsternberg
Copy link
Contributor

Updated help messages, man pages, and replaced the go flag library with
github.com/spf13/pflag for posix compatible flags. Also fixed a bug with
help pages where the command wasn't rewritten correctly. Now influxd help run works correctly again.

Updated scripts to use the new flags and normalized tabs to spaces
within the bash scripts.

@jsternberg jsternberg changed the title Switch influxd to use posix flags Switch binaries to use posix flags Jul 23, 2016
@jsternberg jsternberg force-pushed the js-switch-to-posix-flags branch from 69cc13e to abc222d Compare July 23, 2016 20:04
@jsternberg jsternberg force-pushed the js-switch-to-posix-flags branch from abc222d to 20ce45f Compare July 24, 2016 05:12
"fmt"
"os"

"github.com/influxdata/influxdb/client"
"github.com/influxdata/influxdb/cmd/influx/cli"
flag "github.com/spf13/pflag"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I would prefer we don't alias this. It's confusing as when you read the code later you think it's the standard library flag package.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I'm not keen on aliasing to std library package names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This library is intended to be a drop-in replacement to the flag package and is supposed to be functionally identical. The user of the library isn't supposed to care if this is pflag or flag, which is why this is aliased. Because of the way this is meant to be used, it could also be easy to accidentally intermix two different packages without this alias.

@corylanou
Copy link
Contributor

Is this change primarily for future support? I might of missed it, but I'm not sure what commands benefitted by moving to posix style flags.

@jsternberg
Copy link
Contributor Author

It's mostly to get us to be more similar to other commands on posix systems. I also added a few short options that are listed within the help. Primarily, influxd -c /etc/influxdb/influxdb.conf for a configuration file.

Updated help messages, man pages, and replaced the go flag library with
github.com/spf13/pflag for posix compatible flags. Also fixed a bug with
help pages where the command wasn't rewritten correctly. Now `influxd
help run` works correctly again.

Updated scripts to use the new flags and normalized tabs to spaces
within the bash scripts.
@jsternberg
Copy link
Contributor Author

This is tagged revisit in the future so I'm going to close this and keep the branch around.

@jsternberg jsternberg closed this Sep 2, 2016
@jsternberg jsternberg deleted the js-switch-to-posix-flags branch April 20, 2018 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants