envo 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +21 -0
- data/README.md +66 -0
- data/lib/envo/cmd_clean.rb +1 -1
- data/lib/envo/cmd_list.rb +7 -0
- data/lib/envo/version.rb +1 -1
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4cec2ad575a0169c6dacbf43e31fd020f782223a90f18e4e5f88c773e584d8f
|
4
|
+
data.tar.gz: 5d88e738f7b0f1d2c183d1ce420b10e0c4456b94ef9dcededd59f05f8ff75386
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ff617b289561c7cfbd31dc75be388b370f5170e8103dc6603be2e58f95e8e6178dc7f1824bf295cc7abe82d8681c80fe16aa7842c13230d0265ab84059309b7
|
7
|
+
data.tar.gz: 739f0a9d752398a92accb8e5ed2c53c3fcbec2b5486ac6c7598fdc1fff777ecf2a0b2a1f5ca7b5e12e90e9a8648d3f71f7747d65336d186a19e544d7880afb03
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Borislav Stanimirov
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Envo
|
2
|
+
|
3
|
+
A command-line environment variable manager for the current shell session. It works with bash and Windows cmd.
|
4
|
+
|
5
|
+
Envo offers several commands to view and change environment variables and also to execute simple scripts composed of those commands, thus allowing the same script for a particular env-var configuration on all supported platforms.
|
6
|
+
|
7
|
+
*Envo is still an alpha version. Not all features are complete and not everything is thoroughly tested.*
|
8
|
+
|
9
|
+
## Features
|
10
|
+
|
11
|
+
A screenshot of `envo path` which displays the path in a "pretty" way. Note the tags, `D` for an entry which is duplicated, and `N` for an entry which is a non-existing path
|
12
|
+
|
13
|
+
![Image](doc/screen/bash-path.png)
|
14
|
+
|
15
|
+
Use envo with `envo <command> <args>` in your terminal
|
16
|
+
|
17
|
+
### Commands
|
18
|
+
|
19
|
+
These are select envo commands. For a full list, check the [command reference](doc/commands.md)
|
20
|
+
|
21
|
+
* `show <name> ...` - show values of environment variables in a "pretty" format
|
22
|
+
* `set <name> = [<value>]` - set a value to an environment variable
|
23
|
+
* `unset <name> ...` - unset (delete) an environment variabls
|
24
|
+
* `list <name> add <value>` - add an element to an list environment variable (such as `PATH`)
|
25
|
+
* `clean <name>` - cleans environment variables. Unsets empty strings, non-existing paths, empty lists. Removes duplicates from lists and non-existing paths from path lists.
|
26
|
+
* `run <script>` - runs a simple script of commands. See the [script reference](doc/envoscript.md) on how to write scripts
|
27
|
+
|
28
|
+
## Installation
|
29
|
+
|
30
|
+
* You need a Ruby interpeter version 2.5 or higher
|
31
|
+
* To check, type `ruby --version` in your terminal
|
32
|
+
* Install the ruby gem
|
33
|
+
|
34
|
+
```
|
35
|
+
$ gem install envo
|
36
|
+
```
|
37
|
+
|
38
|
+
* Install the envo command
|
39
|
+
|
40
|
+
```
|
41
|
+
$ envo-install
|
42
|
+
```
|
43
|
+
|
44
|
+
* *If you're using bash, after the last step you'll need to either restart the session, or source the file in which envo was installed (it will be logged after the installation)*
|
45
|
+
|
46
|
+
After this you can type
|
47
|
+
|
48
|
+
```
|
49
|
+
$ envo --help
|
50
|
+
```
|
51
|
+
|
52
|
+
... and see the commands and options supported by envo in your terminal.
|
53
|
+
|
54
|
+
## Contributing
|
55
|
+
|
56
|
+
Issues and pull requests are welcome.
|
57
|
+
|
58
|
+
Part of why I created this tool was to refresh my ruby-foo. I hadn't done much ruby programming for years before this. Because of this, envo is not great (not terrible) ruby code. I would welcome PRs or issues which improve the code style and introduce good practices and dev-tooling into the repo.
|
59
|
+
|
60
|
+
Please take a look at [the implementation notes](doc/impl-notes.md) and [the roadmap](doc/roadmap.md) if you want to contribute.
|
61
|
+
|
62
|
+
## License
|
63
|
+
|
64
|
+
This software is distributed under the MIT Software License. See accompanying LICENSE file or copy [here](https://opensource.org/licenses/MIT).
|
65
|
+
|
66
|
+
Copyright © 2020 [Borislav Stanimirov](http://github.com/iboB)
|
data/lib/envo/cmd_clean.rb
CHANGED
data/lib/envo/cmd_list.rb
CHANGED
@@ -12,6 +12,7 @@ module Envo
|
|
12
12
|
remove a value from a list
|
13
13
|
if the provided value is an integer, it's interpreted as an index in the list
|
14
14
|
EOF
|
15
|
+
help.add_cmd "list <name> clean", "the same as 'clean <name>' (convenience command)"
|
15
16
|
end
|
16
17
|
|
17
18
|
def self.register_cli_parser(parser)
|
@@ -27,6 +28,11 @@ module Envo
|
|
27
28
|
cmd = args.shift
|
28
29
|
return CmdListAdd.parse_cli_args(name, args, opts) if cmd == 'add'
|
29
30
|
return CmdListDel.parse_cli_args(name, args, opts) if cmd == 'del'
|
31
|
+
if cmd == 'clean'
|
32
|
+
opts += CliParser.filter_opts_back(args)
|
33
|
+
raise Envo::Error.new "list-clean: no args needed. Use 'list <name> clean'" if !args.empty?
|
34
|
+
return CmdClean.parse_tokens([name], opts)
|
35
|
+
end
|
30
36
|
|
31
37
|
raise Envo::Error.new "list: unkonwn subcommand #{cmd}"
|
32
38
|
end
|
@@ -43,6 +49,7 @@ module Envo
|
|
43
49
|
cmd = tokens.shift
|
44
50
|
return CmdListAdd.parse_script(name, tokens, opts) if cmd == 'add'
|
45
51
|
return CmdListDel.parse_tokens(name, tokens, opts) if cmd == 'del'
|
52
|
+
return CmdClean.parse_tokens([name], opts) if cmd == 'clean'
|
46
53
|
|
47
54
|
raise Envo::Error.new "list: unkonwn subcommand #{cmd}"
|
48
55
|
end
|
data/lib/envo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: envo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Borislav Stanimirov
|
@@ -10,8 +10,9 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2020-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
14
|
-
|
13
|
+
description: |
|
14
|
+
A CLI environment variable manager.
|
15
|
+
View, set, unset and manage environment variables (strings, lists, paths) on bash and on cmd.
|
15
16
|
email: b.stanimirov@abv.bg
|
16
17
|
executables:
|
17
18
|
- envo-install
|
@@ -19,6 +20,8 @@ executables:
|
|
19
20
|
extensions: []
|
20
21
|
extra_rdoc_files: []
|
21
22
|
files:
|
23
|
+
- LICENSE
|
24
|
+
- README.md
|
22
25
|
- bin/envo-install
|
23
26
|
- bin/envo_gen_tmp_helper.rb
|
24
27
|
- bin/envo_run
|
@@ -65,9 +68,12 @@ licenses:
|
|
65
68
|
- MIT
|
66
69
|
metadata: {}
|
67
70
|
post_install_message: |
|
68
|
-
Thanks for installing envo!
|
69
|
-
For
|
71
|
+
Thanks for installing envo v0.1.1 alpha!
|
72
|
+
For the tool to work you must also run the installation program:
|
73
|
+
$ envo-install
|
70
74
|
Running it will complete the setup and 'envo' should be available as a command.
|
75
|
+
For help run:
|
76
|
+
$ envo --help
|
71
77
|
rdoc_options: []
|
72
78
|
require_paths:
|
73
79
|
- lib
|