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

Short version of the help and version flags #54

Closed
leoheck opened this issue May 20, 2021 · 9 comments
Closed

Short version of the help and version flags #54

leoheck opened this issue May 20, 2021 · 9 comments

Comments

@leoheck
Copy link
Contributor

leoheck commented May 20, 2021

Is it possible to add a short version of these most important flags --help and --verbose (-v -h)?

@jnavila
Copy link
Owner

jnavila commented Jun 8, 2021

Short version -h for help, ok, but -v is usually used for verbose, not version.

@leoheck
Copy link
Contributor Author

leoheck commented Jun 8, 2021

Sure, the right thing is -V for version.

@leoheck
Copy link
Contributor Author

leoheck commented Jun 10, 2021

I would like to have this -V or --version working because for me it is important to check if running your original plotgitsh version or my custom build.

I just don't know yet how to change this version number. It looks like it is opam dependent, since when I build it with makefile the version is missing.

Why?

There is one thing that it is important for kdiff to work. Being able to save to and from images even if they don't have any difference.

I believe you still don't have such a feature, right?

For instance, if we have a flag that allows that, then I could end with my fork to use your repo instead which is a better option, I think since users will have your version installed and not mine.

The way I am achieving this is by removing a test where it compares if images are different before doing the visual diff.

The best thing to do would create a command-line parameter allowing this. However, I believe this test could also be removed because it is good to show to the user an image without any changes. So, this is what the user is expecting.

Well, once the comparison has no differences plotgistch could return a value higher than 0 indicating that, if needed.

@jnavila
Copy link
Owner

jnavila commented Jun 11, 2021

I would like to have this -V or --version working because for me it is important to check if running your original plotgitsh version or my custom build.

Isn't the version working? if you type plotgitsch --version what does it print?

@leoheck
Copy link
Contributor Author

leoheck commented Jun 11, 2021

When I install it by pinning it I see this.

➜ plotgitsch --version
%%VERSION%%

@jnavila
Copy link
Owner

jnavila commented Jun 11, 2021

The substitution with the content of git describe is only performed when calling dune subst in the directory.
So I would recommend:

$ opam install dune
$ dune subst
$ opam pin add -y -k path kicadsch .
$ opam pin add -y -k path plotkicadsch .
$ opam install -y plotkicadsch

Let me know if it changes your version string.

@leoheck
Copy link
Contributor Author

leoheck commented Jun 11, 2021

Look promising, but I am not sure what is going on.

[NOTE] Package kicadsch is already pinned to file:///home/lheck/Dropbox/Documents/plotkicadsch_lheck (version 0.8.0-35-g00077d7-dirty).
[kicadsch.0.8.0-35-g00077d7-dirty] synchronised from file:///home/lheck/Dropbox/Documents/plotkicadsch_lheck
[WARNING] Failed checks on kicadsch package definition from source at file:///home/lheck/Dropbox/Documents/plotkicadsch_lheck:
    error  3: File format error in 'version' at line 2, column 0: Duplicate field version
    error  3: File format error in 'version' at line 3, column 0: Duplicate field version
kicadsch is now pinned to file:///home/lheck/Dropbox/Documents/plotkicadsch_lheck (version 0.8.0-35-g00077d7-dirty)

Already up-to-date.
Nothing to do.

@leoheck
Copy link
Contributor Author

leoheck commented Jun 11, 2021

opam pin remove did the trick.

➜ plotgitsch --version
v0.8.0-35-g00077d7

Pretty nice, thanks.

@jnavila
Copy link
Owner

jnavila commented Jun 11, 2021

I think the dune subst command modifies the working directory. Don't forget to restore the file plotkicadsch/src/plotgitsch.ml when applying it again.

@leoheck leoheck closed this as completed Feb 17, 2022
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