From e4d67f523275b12acca32624d9744cd8e6c9b583 Mon Sep 17 00:00:00 2001 From: Jon Inge Moe Date: Wed, 6 Jan 2021 21:22:20 +0100 Subject: [PATCH] readme fixes --- README.md | 90 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/README.md b/README.md index ea56c95..b2ebf03 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,12 @@ Edit a YAML config file to describe your repositories. ## Commands -* **editor** (alias **e**) - Open repo in the editor defined for that repo -* **getdir** (alias **d**) - Get the root directory of a repo -* **tabtitle** (alias **t**) - Get terminal tab title for repo +* **editor** (alias **e**) - Open repo in the editor defined for that repo. +* **getdir** (alias **d**) - Get the root directory of a repo. +* **tabtitle** (alias **t**) - Get terminal tab title for a repo. +* **config** - Command to initialize or describe a configuration-file. Can also show you the path to the config. -After you build this cli run *repocli help* for all details +After you build this cli run `repocli help` for all commands or `repocli help ` for help on a command ## Build @@ -25,6 +26,45 @@ or `sudo make build /opt/repocli` if you, for example, want to install it in the Make sure the install directory is in you PATH, then verify by running `repocli --version` +## Example config + +```yaml +editors: + - name: goland + params: nosplash + - name: code + params: . +repoes: + - name: some-repo-name + path: /home/username/code/some-repo-name + editor: goland + aliases: + - some + - some-repo + terminal: + title: SOME +``` + +It can also handle mono-repoes: +```yaml + - name: a-monorepo-name + path: /home/username/code/a-monorepo-name + editor: code + aliases: + - amono + terminal: + title: AMONO + monorepo: + - subpath: packages/packagename + terminal: + title: A packagename + - subpath: packages/whatever + terminal: + title: A whatever +``` + +After the cli is built you can see a full example by running `repocli config example` + ## Practical usage `repocli editor ` works out of the box, but if you want to change directory or change terminal tab title this can only be done in the shell itself. I use **bash**, and here are som example usage you may put in your `.bashrc` @@ -59,7 +99,8 @@ ec() { } ``` -You may then run for example `e somealias` or `c somealias` given that *somealias* is the name or an alias of a repo in your config-file (or even if *some-alias* is he name of your repo) +You may then run for example `e somealias` or `c somealias` given that *somealias* is the name or an alias of a +repo in your config-file (or even if *some-alias* is the name of your repo) ### Set terminal tab title in bash ```shell @@ -91,42 +132,3 @@ PROMPT_COMMAND=setTabTitle ``` This should not affect your PROMPT (PS1) and it will set the tab title every time the prompt is writen - -# Example config - -```yaml -editors: - - name: goland - params: nosplash - - name: code - params: . -repoes: - - name: some-repo-name - path: /home/username/code/some-repo-name - editor: goland - aliases: - - some - - some-repo - terminal: - title: SOME -``` - -It can also handle mono-repoes: -```yaml - - name: a-monorepo-name - path: /home/username/code/a-monorepo-name - editor: code - aliases: - - amono - terminal: - title: AMONO - monorepo: - - subpath: packages/packagename - terminal: - title: A packagename - - subpath: packages/whatever - terminal: - title: A whatever -``` - -After the cli is built you can see a full example by running `repocli config example`