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

add extra feature "choosenim show path" #273

Merged
merged 4 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Commands:
update <version/channel> Installs the latest release of the specified
version or channel.
show Displays the selected version and channel.
show path Prints only the path of the current Nim version.
update self Updates choosenim itself.
versions [--installed] Lists available versions of Nim, passing
`--installed` only displays versions that
Expand Down
5 changes: 5 additions & 0 deletions src/choosenim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ proc show(params: CliParams) =
let channel = getCurrentChannel(params)
let path = getSelectedPath(params)
let (_, version) = getNameVersion(path)
if params.commands.len == 2:
let whatToShow = params.commands[1]
if whatToShow.toLowerAscii() == "path":
echo path
return
if version != "":
display("Selected:", version, priority = HighPriority)

Expand Down
1 change: 1 addition & 0 deletions src/choosenimpkg/cliparams.nim
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Commands:
update <version/channel> Installs the latest release of the specified
version or channel.
show Displays the selected version and channel.
show path Prints only the path of the current Nim version.
update self Updates choosenim itself.
versions [--installed] Lists available versions of Nim, passing
`--installed` only displays versions that
Expand Down