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

Support -v / --version in ch binary #2472

Closed
mathiasbynens opened this issue Feb 4, 2017 · 6 comments
Closed

Support -v / --version in ch binary #2472

mathiasbynens opened this issue Feb 4, 2017 · 6 comments

Comments

@mathiasbynens
Copy link
Contributor

There is currently no way to figure out the version of a given ch binary built in release mode:

$ ch -v
Error in opening file: -v: No such file or directory

$ ch --version
Error in opening file: --version: No such file or directory

Please consider making -v / --version (and possibly -h / --help) output something useful.

@dilijev
Copy link
Contributor

dilijev commented Feb 5, 2017

Duplicate of #109

@mathiasbynens
Copy link
Contributor Author

Whoops, apologies! My GitHub issue-searching skills are lacking…

@dilijev
Copy link
Contributor

dilijev commented Feb 7, 2017

@mathiasbynens - Note that -? displays help. (Note also that because of the huge number of flags we support, the help is very verbose.)

@mathiasbynens
Copy link
Contributor Author

@dilijev Not in release mode builds, it seems:

$ ch -?
Error in opening file: -?: No such file or directory

-h / --help is a more conventional, less surprising argument name. Please consider changing it + supporting it in release mode builds :)

Anyway, I meant to say that -? (for test builds) doesn’t output any version information either.

@dilijev
Copy link
Contributor

dilijev commented Feb 7, 2017

@mathiasbynens That's correct, we don't support any flags in release builds. That decision is because of configuration flags but run-mode flags like printing help or version info should probably be supported in release builds. Thanks for reminding that any change in this area should enable those flags for release builds as well.

@dilijev
Copy link
Contributor

dilijev commented Feb 7, 2017

Also note the surprising parameter -? is probably because of the convention of /? in windows cmd commands. We support the leading slash for parameters on Windows only as a legacy feature, so in that sense it still makes sense. There's no conflict with -h, --help, -v, or --version so we can add those.

dilijev added a commit to dilijev/ChakraCore that referenced this issue Feb 8, 2017
Partially addresses chakra-core#109 and chakra-core#2472

```
ch /v
ch /version
ch -v
ch --v
ch -version
ch --version
```

The above all display the version in a simple `<major>.<minor>.<patch>` format, e.g.:

```
1.4.1
```

This flag is available in all flavors (including Release).
dilijev added a commit to dilijev/ChakraCore that referenced this issue Feb 9, 2017
…t in chakra-core#2472.

Enables `-h` and `-help` for non-release builds, and `-?`, `-h`, and `-help` for release builds.

Messages will look as follows.

debug/test builds:

```
Usage: ch.exe [-v|-version] [-h|-help] [-?] [flaglist] <source file>
        -v|-version             Displays version info
        -h|-help                Displays this help message
        -?                      Displays this help message with complete [flaglist] info
```

release builds:

```
Usage: ch.exe [-v|-version] [-h|-help|-?] <source file>
Note: [flaglist] is not supported in Release builds; try a Debug or Test build to enable these flags.
        -v|-version             Displays version info
        -h|-help|-?             Displays this help message
```

The distinction is that `-?` is already implemented in debug/test builds to display full information about the `[flaglist]` options. This is a minimal change here that will result in guiding the user more accurately in all build flavors, the effect of which is that `-?` in debug/test builds is still the only way to get information about the `[flaglist]` options.
chakrabot pushed a commit that referenced this issue Feb 9, 2017
…raCore version.

Merge pull request #2490 from dilijev:version-r14

Partially addresses #109 and #2472.

This is intended as a first pass at the issue to provide some information at this point.

Later, we plan to add more information such as whether a binary was produced as a developer build or an official build, what specific commit the binary was built from, which branch, which machine, etc. The specific set of information that we plan to provide is still being discussed in #109.

```
ch /v
ch /version
ch -v
ch --v
ch -version
ch --version
```

(Supporting `-` and `--` prefixes for short and long flag names is consistent with how we process all behaviors. The logic I used here is a replica of that in `CmdLineArgsParser::Parse`.)

The above all display the version information for `ch` and `ChakraCore` as `<major>.<minor>.<patch>.<QFE>` (note: by convention, ChakraCore's `QFE` is always `0`).

For example on Windows for ChakraCore 1.4.1 with `ch.exe` and `ChakraCore.dll` from the same build:

```
$ ch -v
ch.exe version 1.4.1.0
chakracore.dll version 1.4.1.0
```

If with the same `ch.exe`, if `ChakraCore.dll` was from, e.g., a 2.0.0 build:

```
$ ch -v
ch.exe version 1.4.1.0
chakracore.dll version 2.0.0.0
```

On Linux:

```
~/dev/ChakraCore$ ./BuildLinux/Release/ch -v
ch version 1.4.1.0
```

This flag is available in all flavors (including Release).

---

Updating the help message. Also enable `-h` and `-help` as per request in #2472.

Enables `-h` and `-help` for non-release builds, and `-?`, `-h`, and `-help` for release builds.

Messages will look as follows.

debug/test builds:

```
Usage: ch.exe [-v|-version] [-h|-help] [-?] [flaglist] <source file>
        -v|-version             Displays version info
        -h|-help                Displays this help message
        -?                      Displays this help message with complete [flaglist] info
```

release builds:

```
Usage: ch.exe [-v|-version] [-h|-help|-?] <source file>
Note: [flaglist] is not supported in Release builds; try a Debug or Test build to enable these flags.
        -v|-version             Displays version info
        -h|-help|-?             Displays this help message
```

The distinction is that `-?` is already implemented in debug/test builds to display full information about the `[flaglist]` options. This is a minimal change here that will result in guiding the user more accurately in all build flavors, the effect of which is that `-?` in debug/test builds is still the only way to get information about the `[flaglist]` options.
chakrabot pushed a commit that referenced this issue Feb 9, 2017
…to print ChakraCore version.

Merge pull request #2490 from dilijev:version-r14

Partially addresses #109 and #2472.

This is intended as a first pass at the issue to provide some information at this point.

Later, we plan to add more information such as whether a binary was produced as a developer build or an official build, what specific commit the binary was built from, which branch, which machine, etc. The specific set of information that we plan to provide is still being discussed in #109.

```
ch /v
ch /version
ch -v
ch --v
ch -version
ch --version
```

(Supporting `-` and `--` prefixes for short and long flag names is consistent with how we process all behaviors. The logic I used here is a replica of that in `CmdLineArgsParser::Parse`.)

The above all display the version information for `ch` and `ChakraCore` as `<major>.<minor>.<patch>.<QFE>` (note: by convention, ChakraCore's `QFE` is always `0`).

For example on Windows for ChakraCore 1.4.1 with `ch.exe` and `ChakraCore.dll` from the same build:

```
$ ch -v
ch.exe version 1.4.1.0
chakracore.dll version 1.4.1.0
```

If with the same `ch.exe`, if `ChakraCore.dll` was from, e.g., a 2.0.0 build:

```
$ ch -v
ch.exe version 1.4.1.0
chakracore.dll version 2.0.0.0
```

On Linux:

```
~/dev/ChakraCore$ ./BuildLinux/Release/ch -v
ch version 1.4.1.0
```

This flag is available in all flavors (including Release).

---

Updating the help message. Also enable `-h` and `-help` as per request in #2472.

Enables `-h` and `-help` for non-release builds, and `-?`, `-h`, and `-help` for release builds.

Messages will look as follows.

debug/test builds:

```
Usage: ch.exe [-v|-version] [-h|-help] [-?] [flaglist] <source file>
        -v|-version             Displays version info
        -h|-help                Displays this help message
        -?                      Displays this help message with complete [flaglist] info
```

release builds:

```
Usage: ch.exe [-v|-version] [-h|-help|-?] <source file>
Note: [flaglist] is not supported in Release builds; try a Debug or Test build to enable these flags.
        -v|-version             Displays version info
        -h|-help|-?             Displays this help message
```

The distinction is that `-?` is already implemented in debug/test builds to display full information about the `[flaglist]` options. This is a minimal change here that will result in guiding the user more accurately in all build flavors, the effect of which is that `-?` in debug/test builds is still the only way to get information about the `[flaglist]` options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants