Pushing up more project docs
This commit is contained in:
		
							
								
								
									
										26
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								README.md
									
									
									
									
									
								
							@@ -1,7 +1,29 @@
 | 
			
		||||
# proj
 | 
			
		||||
 | 
			
		||||
## Usage
 | 
			
		||||
 | 
			
		||||
Invoke the script and pass the name of the project as its only non-flag argument:
 | 
			
		||||
 | 
			
		||||
```bash
 | 
			
		||||
proj learncpp
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
If the project exists in your project directory, it will spawn a subshell in that directory. Advanced usage and hooks are detailed below, but you can use it as a glorified `cd` if that's all you need.
 | 
			
		||||
 | 
			
		||||
## Flags
 | 
			
		||||
 | 
			
		||||
flag|description|args
 | 
			
		||||
---|---|---
 | 
			
		||||
-c|Path to a config file to load in place of the default (`~/.config/proj.conf`)|Path to config file
 | 
			
		||||
-h|Print basic help text|
 | 
			
		||||
 | 
			
		||||
## Configuration
 | 
			
		||||
 | 
			
		||||
value|type|description
 | 
			
		||||
value|description|default
 | 
			
		||||
---|---|---
 | 
			
		||||
project\_dir|string|Path to where projects should be stored. Defaults to ~/Projects
 | 
			
		||||
git\_auto\_init|If not set to `0`, automatically initialize a git repository on project creation|`0`
 | 
			
		||||
git\_auto\_init\_always|If not set to `0`, automatically initialize a git repository any time you enter a project and `./.git` does not exist|`0`
 | 
			
		||||
git\_auto\_init\_gitignore|A colon-separated ($PATH-style) list of items to include in the initial `.gitignore`|`*.swp`
 | 
			
		||||
hook\_pre\_create|Path to a script invoked (not sourced) before a project is created. Script will be executed relative to `project_dir`|Empty string
 | 
			
		||||
hook\_pre\_spawn|Path to a script invoked (not sourced) before a shell is spawned in the project directory. Script will be executed relative to the project's root directory|Empty string
 | 
			
		||||
project\_dir|Path to where projects should be stored.|`$HOME/Projects`
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										8
									
								
								proj
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								proj
									
									
									
									
									
								
							@@ -12,8 +12,12 @@ set -e
 | 
			
		||||
declare -r _name="$(basename -- "$0")"
 | 
			
		||||
# Options
 | 
			
		||||
declare -a _config=(
 | 
			
		||||
	[foo]="bar"
 | 
			
		||||
	[baz]="bop"
 | 
			
		||||
	[git_auto_init]="0"
 | 
			
		||||
	[git_auto_init_always]="0"
 | 
			
		||||
	[git_auto_init_gitignore]="*.swp"
 | 
			
		||||
	[hook_pre_create]=""
 | 
			
		||||
	[hook_pre_spawn]=""
 | 
			
		||||
	[project_dir]="$HOME/Projects"
 | 
			
		||||
)
 | 
			
		||||
declare _optconfigfile="${XDG_CONFIG_HOME:-$HOME/.config}/${_name}.conf"
 | 
			
		||||
declare -i _opthelp
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user