Skip to content

Commit

Permalink
Merge pull request #4078 from unisonweb/travis/project-documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aryairani authored Jun 16, 2023
2 parents 97fff2f + 3502387 commit 100598f
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions unison-cli/src/Unison/CommandLine/InputPatterns.hs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,10 @@ deleteProject =
aliases = ["project.delete"],
visibility = I.Hidden,
argTypes = [(Required, projectNameArg)],
help = P.wrap "Delete a project.",
help =
P.wrapColumn2
[ ("`delete.project foo`", "deletes the local project `foo`")
],
parse = \case
[name]
| Right project <- tryInto @ProjectName (Text.pack name) ->
Expand All @@ -739,7 +742,11 @@ deleteBranch =
aliases = ["branch.delete"],
visibility = I.Hidden,
argTypes = [(Required, projectBranchNameWithOptionalProjectNameArg)],
help = P.wrap "Delete a project branch.",
help =
P.wrapColumn2
[ ("`delete.branch foo/bar`", "deletes the branch `bar` in the project `foo`"),
("`delete.branch /bar`", "deletes the branch `bar` in the current project")
],
parse = \case
[name] ->
case tryInto @(ProjectAndBranch (Maybe ProjectName) ProjectBranchName) (Text.pack name) of
Expand Down Expand Up @@ -1132,7 +1139,17 @@ pullImpl name aliases verbosity pullMode addendum = do
<> addendum,
"",
P.wrapColumn2
[ ( makeExample self ["remote", "local"],
[ ( makeExample self ["@unison/base/main"],
"merges the branch `main`"
<> "of the Unison Share hosted project `@unison/base`"
<> "into the current namespace"
),
( makeExample self ["@unison/base/main", "my-base/topic"],
"merges the branch `main`"
<> "of the Unison Share hosted project `@unison/base`"
<> "into the branch `topic` of the local `my-base` project"
),
( makeExample self ["remote", "local"],
"merges the remote namespace `remote`"
<> "into the local namespace `local"
),
Expand Down Expand Up @@ -1648,6 +1665,7 @@ helpTopicsMap =
[ ("testcache", testCacheMsg),
("filestatus", fileStatusMsg),
("messages.disallowedAbsolute", disallowedAbsoluteMsg),
("remotes", remotesMsg),
("namespaces", pathnamesMsg)
]
where
Expand Down Expand Up @@ -1759,6 +1777,19 @@ helpTopicsMap =
<> "temporarily (like `exports.blah.foo`) and then use `move.*` "
<> "or `merge` commands to move stuff around afterwards."
]
remotesMsg =
P.callout "\129302" . P.lines $
[ P.wrap $
"Local projects may be associated with at most one remote project on Unison Share."
<> "When this relationship is established, it becomes the default argument for a"
<> "number of share commands. For example, running `push` or `pull` in a project"
<> "with no arguments will push to or pull from the associated remote, if it exists.",
"",
P.wrap $
"This association is created automatically on when a project is created by `clone`."
<> "If the project was created locally then the relationship will be established on"
<> "the first `push`."
]

help :: InputPattern
help =
Expand Down

0 comments on commit 100598f

Please sign in to comment.