List command
Implement the list command
Exercise
The last command to implement is the list command. This command should display all the environment variables stored in the database for a given directory. If no directory is provided, it will display a list of all stored directories.
list
Lists stored directories or environment variables.
envtamer list [DIRECTORY_NAME]
DIRECTORY_NAME: Optional. The directory to list env variables for.
If no directory is specified, this command lists all directories stored in the database. If a directory is provided, it lists all environment variables stored for that directory.
Go
We will need to implement the last function on the storage class, the listDirectories function. We should be able to implement it without any new packages or functions.
Python
We will need to implement the last command list_command.py. We should be able to implement it without any new packages or functions.
the final file structure should look like this:
âââ envtamer
â  âââ __init__.py
â  âââ cli.py
â  âââ file_handler.py
â  âââ init_command.py
â  âââ list_command.py
â  âââ pull_command.py
â  âââ push_command.py
âââ envtamer_db
â  âââ __init__.py
â  âââ env_variable.py
â  âââ envtamer_db.py
âââ tests
â  âââ __init__.py
âââ poetry.lock
âââ pyproject.toml
âââ README.md
Solution
Solution
git clone --branch 07-list-command --single-branch https://github.com/XPRTZ/envtamer.git