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

Suggestions for improvements #2

Closed
ncw opened this issue Feb 21, 2022 · 12 comments
Closed

Suggestions for improvements #2

ncw opened this issue Feb 21, 2022 · 12 comments
Assignees

Comments

@ncw
Copy link

ncw commented Feb 21, 2022

Nice tool - thank you.

Here are some suggestions for improvements you may not have thought of. It is intended as helpful comments, not criticism, so feel free to implement, adapt or ignore as you choose :-)

Help

gup --help needs more text - this could do with some of the text in the README.md. I wasn't sure how to use the command just by looking at this help.

$ gup --help
Update binaries installed by 'go install'

Usage:
  gup [flags]
  gup [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  import      Install command according to gup.conf
  version     Show version information

Flags:
  -h, --help   help for gup

Use "gup [command] --help" for more information about a command.

Dry run mode

With tools that are making changes to my system, I'd really like a --dry-run mode so I can see what the tool would do if I ran it.

Update named items only

I'd like the tool to be able to update only the binary (or binaries) I mention in the command line, not everything.

Update needs a flag or command

It probably shouldn't update everything unless you pass a flag - say -a or --all, or maybe with a subcommand gup update. I can tell you that sysadmins get upset with commands that do loads of stuff when you run them with no arguments. How do I know this? Well, I write tools for sysadmins and got a lot of very direct feedback!

List

A list subcommand which lists current versions of everything would be nice.

@nao1215 nao1215 self-assigned this Feb 21, 2022
@nao1215
Copy link
Owner

nao1215 commented Feb 21, 2022

@ncw
Thank you for your good suggestions.
I will fix them little by little.

@nao1215
Copy link
Owner

nao1215 commented Feb 21, 2022

gup --help needs more text - this could do with some of the text in the README.md. I wasn't sure how to use the command just by looking at this help.

I update help message. See #3
I add more description when creating subcommands and options.

@nao1215
Copy link
Owner

nao1215 commented Feb 22, 2022

With tools that are making changes to my system, I'd really like a --dry-run mode so I can see what the tool would do if I ran it.

I added --dry-run option. See #5

@nao1215
Copy link
Owner

nao1215 commented Feb 22, 2022

Update named items only

I added --file option. See #12

@nao1215
Copy link
Owner

nao1215 commented Feb 22, 2022

A list subcommand which lists current versions of everything would be nice.

I added list subcommand. See #13

@nao1215
Copy link
Owner

nao1215 commented Feb 22, 2022

@ncw
I have accepted most of your suggestions and added features.
Thank you for your very meaningful comments.

@nao1215 nao1215 closed this as completed Feb 22, 2022
@ncw
Copy link
Author

ncw commented Mar 3, 2022

Very nice changes - thank you :-)

I had a go with the fixes and these are the things I noticed while testing it.


I note that the traditional short flag for --dry-run is -n for some reason (eg see man rsync).

  -d, --dry-run        perform the trial update with no changes

For gup update

  -f, --file strings   specify binary name to be update (e.g.:--file=subaru,gup,go)

Users would normally expect to find these on the command line (I certainly did!) so you'd write

gup update --dry-run subaru gup go
gup update subaru gup go

When you do an update or an update --dry-run, I'd really like to see current version 0.1.1, new version 0.2.1 as it doesn't say at the moment.


When I run the tooll it prints this 29 times! What does it mean? Contains which directory? Can it print it only once with a better error message?

gup:WARN : $GOPATH/bin or $GOBIN contains the directory

@nao1215 nao1215 reopened this Mar 3, 2022
@nao1215
Copy link
Owner

nao1215 commented Mar 3, 2022

OK, OK, OK, OK, I fix them this weekend :) Thank you for your advice.
Now, my baby was born so I can't fix it until the weekend.

nao1215 added a commit that referenced this issue Mar 4, 2022
Improve from "Suggestions for improvements #2"
@nao1215
Copy link
Owner

nao1215 commented Mar 4, 2022

@ncw
I have introduced an improvement plan.
However, I couldn't fix just one. See v0.7.0

I note that the traditional short flag for --dry-run is -n for some reason (eg see man rsync).

Flags:
  -n, --dry-run   perform the trial update with no changes

Users would normally expect to find these on the command line (I certainly did!) so you'd write

gup update --dry-run subaru gup go
gup update subaru gup go

Now

$ gup update subaru gup ubume
gup:INFO : update all binary under $GOPATH/bin or $GOBIN
gup:INFO : [1/3] update success: github.com/nao1215/gup
gup:INFO : [2/3] update success: github.com/nao1215/subaru
gup:INFO : [3/3] update success: github.com/nao1215/ubume/cmd/ubume

When you do an update or an update --dry-run, I'd really like to see current version 0.1.1, new version 0.2.1 as it doesn't say at the moment.

In case of --dry-run, you cannot get the latest version.
dup command can do that by changing $GOBIN to under /tmp/....(It's mean that install binaries under /tmp/...)
However, this method increases the execution time of --dry-run.

I'm wondering whether this method is good or not.

When I run the tooll it prints this 29 times! What does it mean? Contains which directory? Can it print it only once with a better error message?

I deleted this log message.
This log is unnecessary for both developers and users.

@nao1215
Copy link
Owner

nao1215 commented Mar 5, 2022

@ncw

When you do an update or an update --dry-run, I'd really like to see current version 0.1.1, new version 0.2.1 as it doesn't say at the moment.

I implemented it.
See v0.7.1

$ ./gup update -n gal
gup:INFO : update all binary under $GOPATH/bin or $GOBIN
gup:INFO : [1/1] update success: github.com/nao1215/gal/cmd/gal (v1.0.0 to v1.2.0)

@nao1215
Copy link
Owner

nao1215 commented Mar 5, 2022

@ncw
I have accepted all your suggestions.
gup command is better tool, more. Thank you :)

@nao1215 nao1215 closed this as completed Mar 5, 2022
@ncw
Copy link
Author

ncw commented Mar 10, 2022

Thank you too for a very useful tool 🙂

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

2 participants