-
Create new branch for this purpose:
git checkout -b BRANCH_NAME
-
Modify a file in
./command-wrapper/dhall/CommandWrapper/
or./command-wrapper/dhall/Exec/
and don't forget to update semantic hashes ofpackage.dhall
files. -
Commit your changes and push them to GitHub.
-
Update commit and appropriate hashes in:
command-wrapper/src/CommandWrapper/Toolset/InternalSubcommand/Completion/DhallExpressions.hs
Use hash of the commit created in the step 3.
-
Rebuild and run tests:
stack test
-
If all is green then commit&push your changes and do rebase&merge into
master
.# We are on our branch at the moment git rebase master git checkout master git git merge --no-ff OUR_BRANCH_NAME
-
Update versions of
dhall
,dhall-bash
, anddhall-json
in:stack.yaml
-
Update standard version in:
command-wrapper/src/CommandWrapper/Toolset/InternalSubcommand.hs
-
Rebuild and run tests:
stack test
-
Check that output of
version
subcommand is correct by running:stack exec -- command-wrapper version
-
With new version of Dhall we usually get new version of Dhall Prelude. To update it follow instructions in section Adding a new version of Dhall Prelude.
-
Commit&push
-
Introduce new definitions
preludeV<major>_<minor>_<patch>Import
andpreludeV<major>_<minor>_<patch>Content
in:command-wrapper/src/CommandWrapper/Toolset/InternalSubcommand/Completion/DhallExpressions.hs
-
Extend
DhallLibrary
enum incommand-wrapper/src/CommandWrapper/Toolset/InternalSubcommand/Completion/Libraries.hs
To include constructor
PreludeV<major>_<minor>_<patch>
and update functionsparseDhallLibrary
andshowDhallLibrary
accordingly. -
Extend
putDhallLibrary
to handle new cases inDhallLibrary
. GHC will warn you abot this if the previous step is done. -
Introduce a new test case in
command-wrapper/test/Main.hs
to make sure that the embedding of new Dhall Prelude library behaves correctly. -
Rebuild and run tests:
stack test
-
Update documentation of
--dhall=LIBRARY
option in:command-wrapper/man/command-wrapper-completion.1.md
-
Commit&push
-
Lets say that
TOOLSET
variable contains name of our toolset, then we can get a completion function for it from currently running bash by calling:type _${TOOLSET}
Which will print out the completion function with some extra information on top.
-
Store the function definition returned by
type _${TOOLSET}
into a file. -
Modify Bash completion function in the stored file by adding two lines at the end:
# ... Function definition echo "${COMP_CWORD}" "${COMP_WORDS[@]}" >> ~/tmp/completion-debug echo "${COMPREPLY[@]}" >> ~/tmp/completion-debug }
Be aware that completion is invoked by the shell, therefore, things like verbosity and other settings are not passed to it from command line. It may be a good idea to add
--verbosity=annoying
to command wrapper call embedded in the completion function. -
Open another terminal to besides the current one so that both can be seen. Run following in that new terminal:
touch ~/tmp/completion-debug tail -f ~/tmp/completion-debug
-
Go back to previous terminal and source the file with the modified completion function.
-
Start experimenting with completion and you should be able to see the values in the other terminal where the
tail -f
command is running.