New cmder.exe args and shared install capability (#1696)

@MartiUK: Squashing to avoid adding multiple "fixed" commits

* add args to init.bat

* adding args to cmder launcher

* reworked command line parsing and added a /C [path] arg for individual user config location

* removed unnecessary includes

* make shell init scripts work with CMDER_USER_CONFIG

* update tasks and readme.md

* fix git version check

* readme updates

* add register/unregister back in

* fixed git version again

* removed error if user defines user-aliases store file was not present an init.bat launch

* added enhance_path method to only update path if required

* added enhance_path method to only update path if required

* fixed a path prepend issue in enhance path

* init.bat with args is executed outside cmder/conemu sets cmder_root properly. Thanks @DRSDavidSoft

* fixed enhance path append issue

* implements recursive `/bin` path enhancing.

https://github.com/cmderdev/cmder/issues/1624

* added max depth

* changes command line arg to max_depth

* set max_depth default

* readme.md updates

* add back cmder /c [path] arg so it can be used with admin sessions since the env is not shared.

* readme.md updates

* fix /c setting of cmder_user_config

* changelog and readme

* remove bad arg

* fixed command line parsing and updated command line help on error

* Fixed ConEmu.xml file handling so it works again

* Added default user config root location if '/c' is specified and next arg is not another arg
This commit is contained in:
Dax T Games
2018-03-13 10:38:27 -05:00
committed by Martin Kemp
parent ff2e09849e
commit 997e799138
10 changed files with 950 additions and 348 deletions

View File

@ -1,5 +1,60 @@
# Change Log
## [1.3.6-pre1](https://github.com/cmderdev/cmder) (2018-03-01)
**Fixed bugs:**
* Fixed Git version check recently added to master.
**Updates:**
* Modified Cmder tasks in default Conemu.xml to allow easily adding command line args for init.bat by adding some quotes. This resulted in a ton of misc changes to this file. See Adds below.
* Reworked `cmder.exe` command line argument handling to make it more flexible and easily added to.
* Reworked README.md tables to make them more readable in editors
**Implemented enhancements:**
* Added `cmder.exe` command line args documenttion to `README.md`
* Added `:enhance_path` method to vendor\init.bat that modifies the path only if required.
* To prepend: `call :enhance_path "%cmder_root%"`
* to append: `call :enhance_path "%cmder_root%" append`
* Added `:enhance_path_recursive` method to vendor\init.bat that adds a path and all its sub directories to the path if required.
* Max recurse depth default is '1' configurable using `init.bat /max_depth [1-5]`. 6+ results in error.
* To prepend and go 3 levels deep: `call :enhance_path "%cmder_root%" 3`
* To append and go 2 levels deep: `call :enhance_path "%cmder_root%" 2 append`
* Added ability to init.bat to accept command line args and documented them in README.md. Allows users to change the behaviour of init.bat without editing the file.
| Argument | Description | Default |
| ----------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------- |
| /c [user cmder root] | Enables user bin and config folders for 'Cmder as admin' sessions due to non-shared environment. | not set |
| /d | Enables debug output. | not set |
| /git_install_root [file path] | User specified Git installation root path. | '%CMDER_ROOT%\vendor\Git-for-Windows' |
| /home [home folder] | User specified folder path to set `%HOME%` environment variable. | '%userprofile%' |
| /max_depth [1-5] | Define max recurse depth when adding to the path for `%cmder_root%\bin` and `%cmder_user_bin%` | 1 |
| /svn_ssh [path to ssh.exe] | Define %SVN_SSH% so we can use git svn with ssh svn repositories. | '%GIT_INSTALL_ROOT%\bin\ssh.exe' |
| /user_aliases [file path] | File path pointing to user aliases. | '%CMDER_ROOT%\config\user-liases.cmd' |
| /v | Enables verbose output. | not set |
* Added new `cmder.exe /C \<path\>` argument
* To use run Cmder.exe with "/C" command line argument. Example: `cmder.exe /C %userprofile%\cmder_config`
* To use run with `Cmder as Admin` sessions you must specify "/c" command line argument to `init.bat` in tasks. See [README.md](./Readme.md) for details.
* Enables shared Cmder install with Non-Portable Individual User Config
* Supported by all supported shells (cmder, powershell, git bash, and external bash)
* This will create the following directory structure if it is missing.
```
c:\users\[username]\cmder_config
├───bin
└───config
└───profile.d
```
* Shell init scripts run in the following order
1. %cmder_root%\config\profile.d\*.[cmd|ps1|sh]
1. %cmder_root%\config\user-profile.[cmd|ps1|sh]
1. %userprofile%\cmder_config\config\profile.d\*.[cmd|ps1|sh]
1. %userprofile%\cmder_config\config\user-profile.[cmd|ps1|sh]
## [1.3.5](https://github.com/cmderdev/cmder/releases/tag/v1.3.5) (2018-02-11)
This is the first Cmder release that comes with Git for Windows in the 64bit version. If you are still using a 32bit version, you have to fix this yourself.
@ -746,4 +801,4 @@ We now use a forked version of clink since it's original author is missing and w
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*