From 96e06697d3a30747f870f65f13228896822c3a66 Mon Sep 17 00:00:00 2001 From: Lin Guo Date: Fri, 27 Dec 2024 15:25:57 +0000 Subject: [PATCH] Add the missing `ramble docs` command It simply opens up the doc page, same as what Spack does. --- lib/ramble/ramble/cmd/docs.py | 17 +++++++++++++++++ lib/ramble/ramble/main.py | 2 +- share/ramble/ramble-completion.bash | 6 +++++- 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 lib/ramble/ramble/cmd/docs.py diff --git a/lib/ramble/ramble/cmd/docs.py b/lib/ramble/ramble/cmd/docs.py new file mode 100644 index 000000000..9f28050ea --- /dev/null +++ b/lib/ramble/ramble/cmd/docs.py @@ -0,0 +1,17 @@ +# Copyright 2022-2024 The Ramble Authors +# +# Licensed under the Apache License, Version 2.0 or the MIT license +# , at your +# option. This file may not be copied, modified, or distributed +# except according to those terms. + +import webbrowser + +description = "open Ramble documentation in a web browser" +section = "help" +level = "short" + + +def docs(parser, args): + webbrowser.open("https://ramble.readthedocs.io/") diff --git a/lib/ramble/ramble/main.py b/lib/ramble/ramble/main.py index b563e4bd6..c03e38c1b 100644 --- a/lib/ramble/ramble/main.py +++ b/lib/ramble/ramble/main.py @@ -295,7 +295,7 @@ def add_subcommand_group(title, commands): ramble help --all list all commands and options ramble help help on a specific command ramble help --spec help on the application specification syntax - ramble docs open https://ramble.rtfd.io/ in a browser + ramble docs open https://ramble.readthedocs.io/ in a browser """.format( help=section_descriptions["help"] ) diff --git a/share/ramble/ramble-completion.bash b/share/ramble/ramble-completion.bash index 86d42b1ad..eacb6764d 100755 --- a/share/ramble/ramble-completion.bash +++ b/share/ramble/ramble-completion.bash @@ -267,7 +267,7 @@ _ramble() { then RAMBLE_COMPREPLY="-h --help -H --all-help --color -c --config -C --config-scope -d --debug --disable-passthrough -N --disable-logger -P --disable-progress-bar --timestamp --pdb -w --workspace -D --workspace-dir -W --no-workspace --use-workspace-repo -k --insecure -l --enable-locks -L --disable-locks -m --mock --mock-applications --mock-modifiers --mock-package-managers --mock-base-applications --mock-base-modifiers --mock-base-package-managers -p --profile --sorted-profile --lines -v --verbose --stacktrace -V --version --print-shell-vars" else - RAMBLE_COMPREPLY="attributes clean commands config debug deployment edit flake8 help info license list mirror mods on python repo results software-definitions style unit-test workspace" + RAMBLE_COMPREPLY="attributes clean commands config debug deployment docs edit flake8 help info license list mirror mods on python repo results software-definitions style unit-test workspace" fi } @@ -408,6 +408,10 @@ _ramble_deployment_pull() { RAMBLE_COMPREPLY="-h --help --deployment-path -p" } +_ramble_docs() { + RAMBLE_COMPREPLY="-h --help" +} + _ramble_edit() { if $list_options then