8000 Document contexts by martintc · Pull Request #448 · comtrya/comtrya · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Document contexts #448

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

Merged
merged 2 commits into from
Aug 24, 2024
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
3 changes: 0 additions & 3 deletions app/src/commands/contexts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ pub(crate) struct Contexts {

impl ComtryaCommand for Contexts {
fn execute(&self, runtime: &Runtime) -> anyhow::Result<()> {
println!("{}", "This command is a BETA feature. If you have any feedback: https://github.com/comtrya/comtrya/issues/304".italic().bold());
println!();

for (name, context) in runtime.contexts.iter() {
println!("{}", name.to_string().underline().bold());

Expand Down
2 changes: 1 addition & 1 deletion app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ enum Commands {
/// Print version information
Version(commands::Version),

/// List available contexts (BETA)
/// List available contexts
Contexts(commands::Contexts),

/// Auto generate completions
Expand Down
1 change: 1 addition & 0 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- [Supported Systems](./supported-systems.md)
- [Installation](./installation.md)
- [CLI](./cli.md)
- [Commands](./commands.md)
- [Manifests](./manifests.md)
- [Actions](./actions.md)
- [Binary](./binary.md)
Expand Down
77 changes: 77 additions & 0 deletions docs/src/commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Commands

Comtrya offer several commands for use. They can be listed in the terminal by running comtrya with the help command.

```
comtrya help
```

The primary command of use will be the apply command, which will apply the actions of provided manifests to the system.

## Available Commands

| Command | Description |
|:----------------|:---------------------------------------------|
| apply | Apply manifests |
| version | Print version information |
| contexts | List available contexts |
| gen-completions | Auto generate completions |
| help | Print out help information for using comtrya |

## Contexts

The contexts command is useful to see what comtrya knows about. This can be environment variables, included variables, information about the OS, user information and other variables. Below is an exmaple of the output.

```
env
COLORTERM DBUS_SESSION DESKTOP_SES DISPLAY DOTNET_BUND GDMSESSION
_BUS_ADDRESS SION LE_EXTRACT_
BASE_DIR
GNOME_DESKTO GNOME_SHELL_ GNOME_TERMI GNOME_TERMI GPG_AGENT_I GTK_IM_MODU
P_SESSION_ID SESSION_MODE NAL_SCREEN NAL_SERVICE NFO LE
GTK_MODULES HOME LANG LESSCLOSE LESSOPEN LOGNAME
LS_COLORS NVM_BIN NVM_CD_FLAG NVM_DIR NVM_INC OLDPWD
S
PATH PWD QT_ACCESSIB QT_IM_MODUL SESSION_MAN SHELL
ILITY E AGER
SHLVL SSH_AGENT_LA SSH_AUTH_SO SWIFTLY_BIN SWIFTLY_HOM SYSTEMD_EXE
UNCHER CK _DIR E_DIR C_PID
TERM TEXTDOMAIN USER USERNAME VTE_VERSION WINDOWPATH
XAUTHORITY XDG_CONFIG_D XDG_CURRENT XDG_DATA_DI XDG_MENU_PR XDG_RUNTIME
IRS _DESKTOP RS EFIX _DIR
XDG_SESSION_ XDG_SESSION_ XDG_SESSION XMODIFIERS _
CLASS DESKTOP _TYPE

include_variables
<empty>

os
bitness
codename
distribution
edition
family
hostname
name
version

user
config_dir
data_dir
data_local_dir
document_dir
home_dir
id
name
username

variables
<empty>

```

You can also view the values that these contexts have by passing in a `show-values` option as demonstrated below.

```
comtrya contexts --show-values
```
Loading
0