Skip to content

Commit

Permalink
export operation
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Sep 14, 2023
1 parent d326b74 commit 4d94e4f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/operations/shell/setget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ public int cd_main (string[] args) {
}
return 0;
}
public int export_main (string[] args) {
foreach (string arg in args) {
set_env(arg,get_value (arg));
}
return 0;
}

void setget_init () {
operation op_get = new operation ();
Expand Down Expand Up @@ -109,10 +115,19 @@ void setget_init () {
op_cd.help.shell_only = true;
op_cd.help.description = _ ("Change directory.");

operation op_exp = new operation ();
op_exp.help = new helpmsg ();
op_exp.callback.connect (export_main);
op_exp.names = {_ ("export"), "export"};
op_exp.help.name = _ ("export");
op_exp.help.shell_only = true;
op_exp.help.description = _ ("Convert value to environmental.");

add_operation (op_get);
add_operation (op_set);
add_operation (op_equal);
add_operation (op_read);
add_operation (op_match);
add_operation (op_cd);
add_operation (op_exp);
}

0 comments on commit 4d94e4f

Please sign in to comment.