Search is not available for this dataset
hash string | author int32 | committer_date string | timezone int64 | parents string | message string | changes string | language string |
|---|---|---|---|---|---|---|---|
31c709be5caffb675177eea866dcba09ca36fb13 | 9 | 2023-11-22 01:57:58+05:30 | -19,800 | ['e750ee6d286cc831016e095d071463d051bbd98f'] | fix: Opens foreign links from article page in new tab [cw-2725] (#8304)
Co-authored-by: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> | [{'old_path': 'app/javascript/portal/portalHelpers.js', 'new_path': 'app/javascript/portal/portalHelpers.js', 'type': <ModificationType.MODIFY: 5>, 'diff': "@@ -68,6 +68,44 @@ export const updateThemeStyles = theme => {\n setPortalClass(theme);\n };\n \n+export const openExternalLinksInNewTab = () => {\n+ const { cu... | Ruby |
9c7148e2ad49bae15df28dfe44bd167bbe2c6264 | 603 | 2023-11-21 14:51:05-08:00 | 28,800 | ['31c709be5caffb675177eea866dcba09ca36fb13'] | feat: Split dashboard to chunks for build performance (#8394)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com> | [{'old_path': 'app/javascript/dashboard/modules/search/search.routes.js', 'new_path': 'app/javascript/dashboard/modules/search/search.routes.js', 'type': <ModificationType.MODIFY: 5>, 'diff': "@@ -1,7 +1,8 @@\n /* eslint-disable storybook/default-exports */\n-import SearchView from './components/SearchView.vue';\n impo... | Ruby |
96add30331da80810c9b4657e15843d7a5800d24 | 9 | 2023-11-22 08:18:58-08:00 | -19,800 | ['9c7148e2ad49bae15df28dfe44bd167bbe2c6264'] | chore: Add analytics event for insert article feature (#8393) | [{'old_path': 'app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue', 'new_path': 'app/javascript/dashboard/components/widgets/conversation/ReplyBox.vue', 'type': <ModificationType.MODIFY: 5>, 'diff': "@@ -624,6 +624,8 @@ export default {\n `${this.$t('CONVERSATION.REPLYBOX.INSERT_READ_MORE')... | Ruby |
1904ec7df44446bdea04f1a67f92ff65baa468a3 | 540 | 2023-11-22 09:39:41-08:00 | 28,800 | ['96add30331da80810c9b4657e15843d7a5800d24'] | fix: Update campaign routes to fix the rendering issue (#8400) | [{'old_path': 'app/javascript/dashboard/routes/dashboard/settings/campaigns/campaigns.routes.js', 'new_path': 'app/javascript/dashboard/routes/dashboard/settings/campaigns/campaigns.routes.js', 'type': <ModificationType.MODIFY: 5>, 'diff': "@@ -20,7 +20,7 @@ export default {\n path: 'ongoing',\n nam... | Ruby |
90649e72bb6f02ee359dd8103491c62ba5218e63 | 540 | 2023-11-22 10:35:51-08:00 | 28,800 | ['1904ec7df44446bdea04f1a67f92ff65baa468a3'] | fix: Add a .present? check for sentiment file path to avoid false positives (#8401) | [{'old_path': 'enterprise/app/models/enterprise/message.rb', 'new_path': 'enterprise/app/models/enterprise/message.rb', 'type': <ModificationType.MODIFY: 5>, 'diff': "@@ -1,5 +1,5 @@\n module Enterprise::Message\n def update_message_sentiments\n- ::Enterprise::SentimentAnalysisJob.perform_later(self) if ENV.fetch(... | Ruby |
29a778697c6ce14e57d4c746e27b5c15e1a1c99e | 540 | 2023-11-22 13:09:17-08:00 | 28,800 | ['90649e72bb6f02ee359dd8103491c62ba5218e63'] | fix: Remove validation for message signature (#8404) | [{'old_path': 'app/javascript/dashboard/routes/dashboard/settings/profile/MessageSignature.vue', 'new_path': 'app/javascript/dashboard/routes/dashboard/settings/profile/MessageSignature.vue', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -22,14 +22,12 @@\n :enabled-menu-options="customEditorMenuList"\n ... | Ruby |
7efc2726d9c21bb23bd81189fd5202e05e268c74 | 9 | 2023-11-23 02:58:00+05:30 | -19,800 | ['29a778697c6ce14e57d4c746e27b5c15e1a1c99e'] | fix: Updates the text alignment on articles table (#8405) | [{'old_path': 'app/javascript/dashboard/routes/dashboard/helpcenter/components/ArticleItem.vue', 'new_path': 'app/javascript/dashboard/routes/dashboard/helpcenter/components/ArticleItem.vue', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -161,7 +161,7 @@ export default {\n }\n \n span.article-column {\n- @ap... | Ruby |
4fc5f765def0d1d92ed678e6719a307f7994e157 | 603 | 2023-11-22 17:26:08-08:00 | 28,800 | ['7efc2726d9c21bb23bd81189fd5202e05e268c74'] | chore: Make super admin auth error readable (#8406)
- Remove the cryptic error for super admin auth and make it more readable | [{'old_path': 'app/controllers/super_admin/devise/sessions_controller.rb', 'new_path': 'app/controllers/super_admin/devise/sessions_controller.rb', 'type': <ModificationType.MODIFY: 5>, 'diff': "@@ -27,7 +27,8 @@ class SuperAdmin::Devise::SessionsController < Devise::SessionsController\n \n true\n rescue Standard... | Ruby |
2d1f70eb796c801cfefd9f327603b538789605dd | 90 | 2023-11-23 08:16:52+05:30 | -19,800 | ['4fc5f765def0d1d92ed678e6719a307f7994e157'] | feat: Update public portal colors with new design (#8230) | [{'old_path': 'app/controllers/public/api/v1/portals/base_controller.rb', 'new_path': 'app/controllers/public/api/v1/portals/base_controller.rb', 'type': <ModificationType.MODIFY: 5>, 'diff': "@@ -11,11 +11,7 @@ class Public::Api::V1::Portals::BaseController < PublicController\n end\n \n def set_color_scheme\n- ... | Ruby |
a49aaee9cfcc6aff020767320bb8100f536fcc43 | 90 | 2023-11-24 12:14:02+05:30 | -19,800 | ['2d1f70eb796c801cfefd9f327603b538789605dd'] | fix: Email messages in dark mode (#8300) | [{'old_path': 'app/javascript/dashboard/components/widgets/conversation/bubble/Text.vue', 'new_path': 'app/javascript/dashboard/components/widgets/conversation/bubble/Text.vue', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -7,7 +7,11 @@\n }"\n >\n <div v-if="!isEmail" v-dompurify-html="message" class="te... | Ruby |
d2d81d9a96e23f0255397222bb0b4e3165e492dc | 259 | 2018-11-27 08:31:06-05:00 | -32,400 | ['fe5e611709b0c57fa4a89136deaa8e1d4004d053'] | Fix too many underscore for __custom_func (#794)
* Fix too many underscore for __custom_func
* Fix typo of too many leading underscores in docs | [{'old_path': 'bash_completions.go', 'new_path': 'bash_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -134,7 +134,7 @@ __%[1]s_handle_reply()\n \t\t\t__%[1]s_custom_func\n \t\telse\n \t\t\t# otherwise fall back to unqualified for compatibility\n-\t\t\tdeclare -F ___custom_func >/dev/null && __custom... | Go |
7547e83b2d85fd1893c7d76916f67689d761fecb | 482 | 2019-01-08 19:34:09-05:00 | 0 | ['d2d81d9a96e23f0255397222bb0b4e3165e492dc'] | Run tests against go 1.11 and drop 1.9 (#737)
* Update the Travis and CircleCI Go versions
* Adapt to new gofmt formatting
The formatting of gofmt changed slightly in go 1.11. The release
notes recommend to use a specific binary of gofmt. See
https://golang.org/doc/go1.11#gofmt
This commit adapts to the n... | [{'old_path': '.circleci/config.yml', 'new_path': '.circleci/config.yml', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -1,15 +1,11 @@\n-workflows:\n version: 2\n- main:\n- jobs:\n- - go-current\n- - go-previous\n- - go-latest\n-base: &base\n- working_directory: /go/src/github.com/spf13/cobra\n-... | Go |
ba1052d4cbce7aac421a96de820558f75199ccbc | 259 | 2019-03-11 08:55:09-04:00 | -32,400 | ['7547e83b2d85fd1893c7d76916f67689d761fecb'] | Fix two word flags (#807) | [{'old_path': 'bash_completions.go', 'new_path': 'bash_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -199,7 +199,8 @@ __%[1]s_handle_flag()\n fi\n \n # skip the argument to a two word flag\n- if __%[1]s_contains_word "${words[c]}" "${two_word_flags[@]}"; then\n+ if [[ ${words[c]} != *... | Go |
5755ecf10233c1acfd87d417bc6605a30702c0a8 | 41 | 2019-03-20 17:21:26-04:00 | -3,600 | ['ba1052d4cbce7aac421a96de820558f75199ccbc'] | [TrivialPatches] Typos in README.md, fix and update CI, update projects list... (#840)
* update Example in README.md (#769)
* specify the color as the required arg (#777)
* command: fix typo in docstring of InheritedFlags (#779)
* add istio to the list of projects built with Cobra (#786)
* remove redundant... | [{'old_path': '.circleci/config.yml', 'new_path': '.circleci/config.yml', 'type': <ModificationType.MODIFY: 5>, 'diff': "@@ -15,13 +15,13 @@ references:\n PATH=$PATH:$PWD/bin go test -v ./...\n go build\n if [ -z $NOVET ]; then\n- diff -u <(echo -n) <(go tool vet . 2>&1 | grep -vE 'Exam... | Go |
67fc4837d267bc9bfd6e47f77783fcc3dffc68de | 624 | 2019-03-20 20:05:52-04:00 | -3,600 | ['5755ecf10233c1acfd87d417bc6605a30702c0a8'] | added variable to allow configuration of mousetrap message duration (#809)
new variable MousetrapDisplayDuration allows to modify the default
display duration of 5s, or to completely disable the timeout and wait
for the user to press the return key. | [{'old_path': 'cobra.go', 'new_path': 'cobra.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -23,6 +23,7 @@ import (\n \t"strconv"\n \t"strings"\n \t"text/template"\n+\t"time"\n \t"unicode"\n )\n \n@@ -56,6 +57,12 @@ var MousetrapHelpText string = `This is a command line tool.\n You need to open cmd.exe and run ... | Go |
7e2436b79de609152fc3bcf7fc945b7b134ea825 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['67fc4837d267bc9bfd6e47f77783fcc3dffc68de'] | First try at better zsh completions:
A very basic POC. Need to refactor to generate completion
structure before passing to the template to avoid repeated
computations.
What works:
* Real zsh completion (not built on bash)
* Basic flags (with long flag and optional shorthand)
* Basic filename completion indicati... | [{'old_path': None, 'new_path': 'Gopkg.lock', 'type': <ModificationType.ADD: 1>, 'diff': '@@ -0,0 +1,132 @@\n+# This file is autogenerated, do not edit; changes may be undone by the next \'dep ensure\'.\n+\n+\n+[[projects]]\n+ name = "github.com/cpuguy83/go-md2man"\n+ packages = ["md2man"]\n+ revision = "20f5889cbdc... | Go |
a15d0990180cf0d99905ad41201211f8ac3cab53 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['7e2436b79de609152fc3bcf7fc945b7b134ea825'] | zsh-completion fixed reference to cmd name
cmd.Use is not the command name :). Found it once I figured out
that I need to execute the command in order to fully test the
generated completion. | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -15,6 +15,7 @@ var (\n \t\t"constructPath": constructPath,\n \t\t"subCmdList": subCmdList,\n \t\t"extractFlags": extractFlags,\n+\t\t"cmdName": cmdName,\n \t\t"simpleFlag": simpleFlag,\n ... | Go |
f0508c8e7665e581c7880c232466fe77b7a8964b | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['a15d0990180cf0d99905ad41201211f8ac3cab53'] | zsh-completion ignores hidden commands and flags :) | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -45,11 +45,11 @@ function {{constructPath .}} {\n {{end}} "1: :({{subCmdList .}})" \\\n "*::arg:->args"\n \n- case $line[1] in {{- range .Commands}}\n+ case $line[1] in {{- range .Command... | Go |
2662787697b4d82e32836f2305918a0c22baae69 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['f0508c8e7665e581c7880c232466fe77b7a8964b'] | zsh-completion: added support for subcommand description.
Also make the template more elegant on the way... | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -37,43 +37,50 @@ var (\n {{/* should accept Command (that contains subcommands) as parameter */}}\n {{define "argumentsC" -}}\n function {{constructPath .}} {\n- local line\n+ local -a commands\n \n... | Go |
e8018e8612d3a4fe2f8a40c01796b15ae705ff22 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['2662787697b4d82e32836f2305918a0c22baae69'] | zsh-completion template refactoring:
- removed redundant function
- improved other functions :)
- better names for other functions | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -4,7 +4,6 @@ import (\n \t"fmt"\n \t"io"\n \t"os"\n-\t"strings"\n \t"text/template"\n \n \t"github.com/spf13/pflag"\n@@ -12,10 +11,8 @@ import (\n \n var (\n \tfuncMap = template.FuncMap{\n-\t\t"const... | Go |
ec4b8c974c81c2077fb0f8dcd6cfe0f627b228f9 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['e8018e8612d3a4fe2f8a40c01796b15ae705ff22'] | zsh-completions: revised flags completion rendering + new features:
- If the flags are not bool the completion expects argument.
- You don't have to specify file extensions for file completion to
work.
- Allow multiple occurrences of flag if type is stringArray.
Need to verify that these assumption are correct :) | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -4,6 +4,7 @@ import (\n \t"fmt"\n \t"io"\n \t"os"\n+\t"strings"\n \t"text/template"\n \n \t"github.com/spf13/pflag"\n@@ -13,24 +14,9 @@ var (\n \tfuncMap = template.FuncMap{\n \t\t"genZshFuncName": ... | Go |
e9ee8f044615ebe5f59ec8423e3b80e0e05cd7ab | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['ec4b8c974c81c2077fb0f8dcd6cfe0f627b228f9'] | zsh-completion: removed the _dep_ files.
They were committed by mistake. | [{'old_path': 'Gopkg.lock', 'new_path': None, 'type': <ModificationType.DELETE: 4>, 'diff': '@@ -1,132 +0,0 @@\n-# This file is autogenerated, do not edit; changes may be undone by the next \'dep ensure\'.\n-\n-\n-[[projects]]\n- name = "github.com/cpuguy83/go-md2man"\n- packages = ["md2man"]\n- revision = "20f5889c... | Go |
df12a0a24975e4c9f278e62927ca08d000b9be71 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['e9ee8f044615ebe5f59ec8423e3b80e0e05cd7ab'] | zsh-completion: two fixes for identifying flag usage:
Fixed after input from @eparis:
- Decide on option parameter by checking NoOptDefVal
- Slices also could be specified multiple times. | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -131,7 +131,7 @@ func genFlagEntryForZshArguments(f *pflag.Flag) string {\n func genFlagEntryForSingleOptionFlag(f *pflag.Flag) string {\n \tvar option, multiMark, extras string\n \n-\tif f.Value.Type... | Go |
461a39d5b9353091df9cd9852334113d2d9f22b9 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['df12a0a24975e4c9f278e62927ca08d000b9be71'] | zsh-completion: removed forgotten function. | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -115,10 +115,6 @@ func extractFlags(c *Command) []*pflag.Flag {\n \treturn flags\n }\n \n-func simpleFlag(p *pflag.Flag) bool {\n-\treturn p.Name == "" || p.Shorthand == ""\n-}\n-\n // genFlagEntryFor... | Go |
dd577bdf3103152e76d48bdb168460f239bdfa29 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['461a39d5b9353091df9cd9852334113d2d9f22b9'] | zsh-completion: added zsh-completion documentation. | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -48,6 +48,7 @@ etc.\n * [Suggestions when "unknown command" happens](#suggestions-when-unknown-command-happens)\n * [Generating documentation for your command](#generating-documentation-for-your-command)\n * [Gen... | Go |
bda855a1a0bf7a7c2d9402a6250d53615dacd294 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['dd577bdf3103152e76d48bdb168460f239bdfa29'] | zsh-completions: fixed zsh completion markdown file name. | [{'old_path': 'zsh_completion.md', 'new_path': 'zsh_completions.md', 'type': <ModificationType.RENAME: 3>, 'diff': ''}] | Go |
50f385938e098a69ec93b3490ff68442ec3d6524 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['bda855a1a0bf7a7c2d9402a6250d53615dacd294'] | zsh-completion: added support for filename globbing. | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -137,7 +137,7 @@ func genFlagEntryForSingleOptionFlag(f *pflag.Flag) string {\n \t}\n \textras = genZshFlagEntryExtras(f)\n \n-\treturn fmt.Sprintf(`"%s%s[%s]%s"`, multiMark, option, f.Usage, extras)\... | Go |
0d9a33d2da4a2006f3d2293b4a2f0b436228ee54 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['50f385938e098a69ec93b3490ff68442ec3d6524'] | zsh-completion: remove temporary file
Yet another temporary file that found itself in the repo :( | [{'old_path': 'zsh_template.tmpl', 'new_path': None, 'type': <ModificationType.DELETE: 4>, 'diff': '@@ -1,56 +0,0 @@\n-{{define "complexFlag"}}{{ /* for pflag.Flag with short and long options */ -}}\n-"(-{{.Shorthand}} --{{.Name}})"\\{-{{.Shorthand}}, --{{.Name}}\\}[{{.Usage}}]\n-{{- end}}\n-\n-{{define "simpleFlag"}}{... | Go |
91e80cc4a4b48b031b65a5cd4024ed5b113c131f | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['0d9a33d2da4a2006f3d2293b4a2f0b436228ee54'] | zsh-completion: remove bad test
I thought there was a bug in the boolSlice definition but it seems
It was my mistake in identifying what's going on. Also removed the
provisioning to skip tests (doesn't seem to be needed anymore). | [{'old_path': 'zsh_completions_test.go', 'new_path': 'zsh_completions_test.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -15,7 +15,6 @@ func TestGenZshCompletion(t *testing.T) {\n \t\tname string\n \t\troot *Command\n \t\texpectedExpressions []string\n-\t\tskip stri... | Go |
7ce08e227e8c9db9b243dfef1e792af31d19cdd0 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['91e80cc4a4b48b031b65a5cd4024ed5b113c131f'] | zsh-completion: completion should always parse the root command!
It was running on the command it was invoked from which caused some
additional helpers (--help, --version) not to be generated. | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -84,13 +84,15 @@ func (c *Command) GenZshCompletionFile(filename string) error {\n \treturn c.GenZshCompletion(outFile)\n }\n \n-// GenZshCompletion generates a zsh completion file and writes to the p... | Go |
7b62c7df786ae4a385717290f9f5b8f2c4edc6b9 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['7ce08e227e8c9db9b243dfef1e792af31d19cdd0'] | zsh-completion: --version and --help still doesn't work correctly
When invoking from subcommand. Modified the test to prove. | [{'old_path': 'zsh_completions_test.go', 'new_path': 'zsh_completions_test.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -15,6 +15,8 @@ func TestGenZshCompletion(t *testing.T) {\n \t\tname string\n \t\troot *Command\n \t\texpectedExpressions []string\n+\t\tinvocationArgs []st... | Go |
66a98807d4036a0b21797ad8434b97a9ce0ae49d | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['7b62c7df786ae4a385717290f9f5b8f2c4edc6b9'] | zsh-completion: test to verify that we're always running on root cmd. | [{'old_path': 'zsh_completions_test.go', 'new_path': 'zsh_completions_test.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -134,6 +134,18 @@ func TestGenZshCompletion(t *testing.T) {\n \t\t\t},\n \t\t\tskip: "--version and --help are currently not generated when not running on root command",\n \t\t},\n+\t\t{\n+\... | Go |
8822449c0fb9575f1d2453e80cd3e55ab8fc2844 | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['66a98807d4036a0b21797ad8434b97a9ce0ae49d'] | zsh-completion: added escapinng of single quotes in flag description. | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -139,7 +139,7 @@ func genFlagEntryForSingleOptionFlag(f *pflag.Flag) string {\n \t}\n \textras = genZshFlagEntryExtras(f)\n \n-\treturn fmt.Sprintf(`\'%s%s[%s]%s\'`, multiMark, option, f.Usage, extras... | Go |
d262154093af3bc0c8d63a8dbadaa13e7807360a | 341 | 2019-06-07 10:09:50-04:00 | -7,200 | ['8822449c0fb9575f1d2453e80cd3e55ab8fc2844'] | zsh-completion: tidy up function and variable names
There are many files in the package, renamed all zsh-completion
related names to convey that. | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -11,10 +11,10 @@ import (\n )\n \n var (\n-\tfuncMap = template.FuncMap{\n-\t\t"genZshFuncName": generateZshCompletionFuncName,\n-\t\t"extractFlags": extractFlags,\n-\t\t"g... | Go |
edbb6712e2cba085bb278feeb1b88ae88079ecdf | 341 | 2019-06-07 10:09:50-04:00 | -10,800 | ['d262154093af3bc0c8d63a8dbadaa13e7807360a'] | zsh-completions: implemented argument completion. | [{'old_path': 'zsh_completions.go', 'new_path': 'zsh_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -1,20 +1,29 @@\n package cobra\n \n import (\n+\t"encoding/json"\n \t"fmt"\n \t"io"\n \t"os"\n+\t"sort"\n \t"strings"\n \t"text/template"\n \n \t"github.com/spf13/pflag"\n )\n \n+const (\n+\tzshCompAr... | Go |
e2c45ac9eb0cdb823b89c1e868d698dc74822797 | 341 | 2019-06-07 10:09:50-04:00 | -10,800 | ['601d83077b12a12f839d20881d9e5d3075aaad1b'] | Started working on Unified API for the various shell completions:
- Moved some general function to a more generic shell_completions file.
- Added functions to mark flag as directory completion.
- Started making the global functions docs more generic (not bash
specific) and added compatibility matrix. | [{'old_path': 'bash_completions.go', 'new_path': 'bash_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -545,51 +545,3 @@ func (c *Command) GenBashCompletionFile(filename string) error {\n \n \treturn c.GenBashCompletion(outFile)\n }\n-\n-// MarkFlagRequired adds the BashCompOneRequiredFlag annotation... | Go |
d658160bddb021fa7747c7920de931d8ef8e68c3 | 384 | 2019-06-07 10:26:08-04:00 | 0 | ['21ccc7b307f4a6453e393a0ce1fe40eedbeffa2d'] | Add markdown file explaining support for PowerShell | [{'old_path': None, 'new_path': 'powershell_completions.md', 'type': <ModificationType.ADD: 1>, 'diff': "@@ -0,0 +1,14 @@\n+# Generating PowerShell Completions For Your Own cobra.Command\n+\n+Cobra can generate PowerShell completion scripts. Users need PowerShell version 5.0 or above, which comes with Windows 10 and ca... | Go |
80ea2901b62e9663b6104d03362f5042b57836b7 | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['d658160bddb021fa7747c7920de931d8ef8e68c3'] | vgo-support - re-working code generator | [{'old_path': 'cobra/cmd/init.go', 'new_path': 'cobra/cmd/init.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -15,15 +15,20 @@ package cmd\n \n import (\n \t"fmt"\n+\t"github.com/spf13/cobra/cobra/tpl"\n \t"os"\n \t"path"\n \t"path/filepath"\n+\t"text/template"\n \n \t"github.com/spf13/cobra"\n \t"github.com/sp... | Go |
c356c6491b84c9d61ca6558ab5a3d2efbe0a751f | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['80ea2901b62e9663b6104d03362f5042b57836b7'] | add .idea/* to gitignore | [{'old_path': '.gitignore', 'new_path': '.gitignore', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -34,3 +34,5 @@ tags\n *.exe\n \n cobra.test\n+\n+.idea/*\n'}] | Go |
26d210e2cd929a8d5f57a08cd0391eae58c4c687 | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['c356c6491b84c9d61ca6558ab5a3d2efbe0a751f'] | vgo - fixing up the root template | [{'old_path': 'cobra/cmd/init.go', 'new_path': 'cobra/cmd/init.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -56,20 +56,38 @@ Init will not use an existing directory with contents.`,\n \t\t\t\tPkgName: pkgName,\n \t\t\t\tLegal: getLicense(),\n \t\t\t\tCopyright: copyrightLine(),\n+\t\t\t\t// vip... | Go |
abab9aa52a698bb6fcb945b10968695ec52379aa | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['69420a9ffa803f0f0990be1fb8ea9ec69fd5fb69'] | vgo - add Create method to Project struct | [{'old_path': 'cobra/cmd/init.go', 'new_path': 'cobra/cmd/init.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -15,14 +15,11 @@ package cmd\n \n import (\n \t"fmt"\n-\t"github.com/spf13/cobra/cobra/tpl"\n+\t"github.com/spf13/cobra"\n+\t"github.com/spf13/viper"\n \t"os"\n \t"path"\n \t"path/filepath"\n-\t"text/te... | Go |
4c22a20fd45b379d3e9b9223dd76445e269199e4 | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['73b5215dc72c245abe81cc72b7c1adfc1ebfab70'] | vgo - remove unused methods | [{'old_path': 'cobra/cmd/init.go', 'new_path': 'cobra/cmd/init.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -19,7 +19,6 @@ import (\n \t"github.com/spf13/viper"\n \t"os"\n \t"path"\n-\t"path/filepath"\n )\n \n var (\n@@ -70,164 +69,3 @@ func init() {\n \tinitCmd.Flags().StringVar(&pkgName, "pkg-name", "", "fu... | Go |
e993d53002aa6dca9d85ed6d8633a6984c3eafb1 | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['04af6aed80d3a451ea8de88881be0239804d5f42'] | vgo - take named directory or current wd | [{'old_path': 'cobra/cmd/init.go', 'new_path': 'cobra/cmd/init.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -47,9 +47,11 @@ Init will not use an existing directory with contents.`,\n \t\t\t\ter(err)\n \t\t\t}\n \n-\t\t\t// todo:\n-\t\t\t// if . use current directory\n-\t\t\t// else create named directory and ... | Go |
642c3c7a0edbb0242be3f380808df5474e377291 | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['e993d53002aa6dca9d85ed6d8633a6984c3eafb1'] | vgo - compare generated files against golden files | [{'old_path': 'cobra/cmd/init_test.go', 'new_path': 'cobra/cmd/init_test.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -1,19 +1,16 @@\n package cmd\n \n import (\n-\t"errors"\n-\t"io/ioutil"\n+\t"fmt"\n \t"os"\n \t"path/filepath"\n \t"testing"\n-\n-\t"github.com/spf13/viper"\n )\n \n func TestGoldenInitCmd(t *... | Go |
50665e99933b63952bde8df17bfe2113ab6dbe44 | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['642c3c7a0edbb0242be3f380808df5474e377291'] | vgo - update golden templates | [{'old_path': 'cobra/cmd/init_test.go', 'new_path': 'cobra/cmd/init_test.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -13,6 +13,7 @@ func TestGoldenInitCmd(t *testing.T) {\n \t\tAbsolutePath: fmt.Sprintf("%s/testproject", wd),\n \t\tPkgName: "github.com/spf13/testproject",\n \t\tLegal: getLicense(... | Go |
c7ac101cf82f9a5660532cdd00fb5e908b359c29 | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['3741457400aa1a40bac77971975dc4d99360764e'] | vgo - fixing up the add op to work with vgo | [{'old_path': 'cobra/cmd/add.go', 'new_path': 'cobra/cmd/add.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -16,20 +16,17 @@ package cmd\n import (\n \t"fmt"\n \t"os"\n-\t"path/filepath"\n+\t"path"\n \t"unicode"\n \n \t"github.com/spf13/cobra"\n )\n \n-func init() {\n-\taddCmd.Flags().StringVarP(&packageName, "... | Go |
732e4db0d43f782e8b3b576c433db2b811171386 | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['c7ac101cf82f9a5660532cdd00fb5e908b359c29'] | vgo - trim some uneeded data from struct | [{'old_path': 'cobra/cmd/add.go', 'new_path': 'cobra/cmd/add.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -16,7 +16,6 @@ package cmd\n import (\n \t"fmt"\n \t"os"\n-\t"path"\n \t"unicode"\n \n \t"github.com/spf13/cobra"\n@@ -60,8 +59,8 @@ Example: cobra add server -> resulting in a new cmd/server.go`,\n \t\t\... | Go |
2fea75b02e2e18fab31f754b0f014944b3d9e42d | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['3c42f846c2b95e5a47f3793932a9f98f0e3cc49f'] | vgo - add command working | [{'old_path': 'cobra/cmd/project.go', 'new_path': 'cobra/cmd/project.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -98,10 +98,11 @@ func (c *Command) Create() error {\n \tdefer cmdFile.Close()\n \n \tcommandTemplate := template.Must(template.New("sub").Parse(string(tpl.AddCommandTemplate())))\n-\terr = command... | Go |
0bb1506d255f827d36e044d13fa2b5470bca4009 | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['2fea75b02e2e18fab31f754b0f014944b3d9e42d'] | remove commented field in struct | [{'old_path': 'cobra/cmd/add.go', 'new_path': 'cobra/cmd/add.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -54,8 +54,6 @@ Example: cobra add server -> resulting in a new cmd/server.go`,\n \t\t\t\tCmdParent: parentName,\n \t\t\t\tProject: &Project{\n \t\t\t\t\tAbsolutePath: fmt.Sprintf("%s/cmd", wd),\n-\t\t\t\t... | Go |
303a3e5160b0d2d72ca96ed9eff9e016fe54b2f9 | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['0bb1506d255f827d36e044d13fa2b5470bca4009'] | vgo - strip out unused methods | [{'old_path': 'cobra/cmd/project.go', 'new_path': 'cobra/cmd/project.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -4,9 +4,6 @@ import (\n \t"fmt"\n \t"github.com/spf13/cobra/cobra/tpl"\n \t"os"\n-\t"path/filepath"\n-\t"runtime"\n-\t"strings"\n \t"text/template"\n )\n \n@@ -20,12 +17,11 @@ type Project struct ... | Go |
984374f5b622efc94388e2872915c2d97404adba | 399 | 2019-06-07 10:31:03-04:00 | 28,800 | ['11aa612384e0e18662f319528bde7b68ffca43ee'] | clean up testproject files after test executes | [{'old_path': 'cobra/cmd/add_test.go', 'new_path': 'cobra/cmd/add_test.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -16,9 +16,22 @@ func TestGoldenAddCmd(t *testing.T) {\n \t\t\tAbsolutePath: fmt.Sprintf("%s/testproject", wd),\n \t\t\tLegal: getLicense(),\n \t\t\tCopyright: copyrightLine(),\n+\n+\t\... | Go |
9eb9f5c66b643a25cb4c468e3a585c4d3a31c689 | 358 | 2019-06-07 10:33:55-04:00 | -10,800 | ['2411ac592a8a714d324edd1abc880a55c17a9de0'] | Add gardenctl to projects build using Cobra
Signed-off-by: ialidzhikov <i.alidjikov@gmail.com> | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -23,6 +23,7 @@ Many of the most widely used Go projects are built using Cobra, such as:\n [Istio](https://istio.io),\n [Prototool](https://github.com/uber/prototool),\n [mattermost-server](https://github.com/mattermost... | Go |
5f23f55c8183489b4e881ff0dc99ac6a746baa0c | 332 | 2019-06-07 10:47:24-04:00 | -25,200 | ['9eb9f5c66b643a25cb4c468e3a585c4d3a31c689'] | Update README.md
To avoid confusion, it is better to use `localCmd` instead of `rootCmd` | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -338,7 +338,7 @@ rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "verbose out\n A flag can also be assigned locally which will only apply to that specific command.\n \n ```go\n-rootCmd.Flags().Strin... | Go |
4a716d101b39c61535dbb10aa765dfee95b41085 | 429 | 2019-06-07 10:48:23-04:00 | -3,600 | ['5f23f55c8183489b4e881ff0dc99ac6a746baa0c'] | Extending redirection to stdout, stderr, stdin | [{'old_path': 'command.go', 'new_path': 'command.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -177,8 +177,6 @@ type Command struct {\n \t// that we can use on every pflag set and children commands\n \tglobNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName\n \n-\t// output is an output writer defi... | Go |
618bc00f8084be91329cbceb8094a7e5190a6c29 | 429 | 2019-06-07 10:48:23-04:00 | -3,600 | ['0ea93dd60d8a44862790c8751955bdf65be0c4ce'] | Allow for explicit output to err/stderr | [{'old_path': 'command.go', 'new_path': 'command.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -1121,6 +1121,21 @@ func (c *Command) Printf(format string, i ...interface{}) {\n \tc.Print(fmt.Sprintf(format, i...))\n }\n \n+// PrintErr is a convenience method to Print to the defined Err output, fallback to Stde... | Go |
cb27ce11fba1a33e42233dea2658805c62a17e74 | 429 | 2019-06-07 10:48:23-04:00 | -3,600 | ['618bc00f8084be91329cbceb8094a7e5190a6c29'] | Deprecate and maintain backwards compatibility | [{'old_path': 'command.go', 'new_path': 'command.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -210,8 +210,10 @@ func (c *Command) SetArgs(a []string) {\n \n // SetOutput sets the destination for usage and error messages.\n // If output is nil, os.Stderr is used.\n+// Deprecated: Use SetOut and/or SetErr inste... | Go |
21f39ca07ee7bf0c29e1bbdb2ab35df70c64b4b2 | 568 | 2019-07-11 12:18:47-06:00 | -7,200 | ['f2b07da1e2c38d5f12845a4f607e2e1018cbb1f5'] | bash: fix shellcheck errors (#889)
https://github.com/koalaman/shellcheck/wiki/SC2207
https://github.com/koalaman/shellcheck/wiki/SC2164 | [{'old_path': 'bash_completions.go', 'new_path': 'bash_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -72,7 +72,9 @@ __%[1]s_handle_reply()\n else\n allflags=("${flags[*]} ${two_word_flags[*]}")\n fi\n- COMPREPLY=( $(compgen -W "${allflags[*]}" -- "... | Go |
9a31ddff0ea7ee4045c71a113ff135917752383b | 239 | 2019-07-12 09:55:10-06:00 | 25,200 | ['21f39ca07ee7bf0c29e1bbdb2ab35df70c64b4b2'] | Add Linkerd to list of projects using Cobra (#892) | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -24,6 +24,7 @@ Many of the most widely used Go projects are built using Cobra, such as:\n [Prototool](https://github.com/uber/prototool),\n [mattermost-server](https://github.com/mattermost/mattermost-server),\n [Garde... | Go |
2d7544ebdeb5f926805c57af8dccc6c359de28d4 | 41 | 2019-07-15 09:44:15-06:00 | -7,200 | ['9a31ddff0ea7ee4045c71a113ff135917752383b'] | fix missing newline in cmd/add (#905) | [{'old_path': 'cobra/cmd/add.go', 'new_path': 'cobra/cmd/add.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -64,7 +64,7 @@ Example: cobra add server -> resulting in a new cmd/server.go`,\n \t\t\t\ter(err)\n \t\t\t}\n \n-\t\t\tfmt.Printf("%s created at %s", command.CmdName, command.AbsolutePath)\n+\t\t\tfmt.Prin... | Go |
1c9c46d5c1cc2aaebdd1898c0680e85e8a44b36d | 399 | 2019-07-24 10:10:51-06:00 | 21,600 | ['2d7544ebdeb5f926805c57af8dccc6c359de28d4'] | Update Generator Docs to reflect changes brought in #817 (#904) | [{'old_path': 'cobra/README.md', 'new_path': 'cobra/README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -16,11 +16,23 @@ for you. It is a very powerful application that will populate your program with\n the right structure so you can immediately enjoy all the benefits of Cobra. It\n will also automatically ap... | Go |
af29f95b816b2d9ac6ed548f991dc3acca113280 | 231 | 2019-08-02 01:25:21+05:00 | 25,200 | ['1c9c46d5c1cc2aaebdd1898c0680e85e8a44b36d'] | Add ignore of cobra posix binary and all of intellij generated files | [{'old_path': '.gitignore', 'new_path': '.gitignore', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -32,7 +32,8 @@ Session.vim\n tags\n \n *.exe\n-\n+cobra\n cobra.test\n \n-.idea/*\n+.idea/\n+*.iml\n'}] | Go |
955267993934d057ed4c6e9785a446c2dbf012da | 231 | 2019-08-02 01:25:21+05:00 | 25,200 | ['af29f95b816b2d9ac6ed548f991dc3acca113280'] | Add idiomatic handling of go error in distinct main func | [{'old_path': 'cobra/cmd/root.go', 'new_path': 'cobra/cmd/root.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -36,8 +36,8 @@ to quickly create a Cobra application.`,\n )\n \n // Execute executes the root command.\n-func Execute() {\n-\trootCmd.Execute()\n+func Execute() error {\n+\treturn rootCmd.Execute()\n }\... | Go |
9334a46bd6b3887f3561d705440038ec93b7f62e | 231 | 2019-08-02 01:25:21+05:00 | 25,200 | ['955267993934d057ed4c6e9785a446c2dbf012da'] | Return an error in the case of unrunnable subcommand
* credit to @chriswhelix for initial commit | [{'old_path': 'command.go', 'new_path': 'command.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -17,6 +17,7 @@ package cobra\n \n import (\n \t"bytes"\n+\t"errors"\n \t"fmt"\n \t"io"\n \t"os"\n@@ -27,6 +28,9 @@ import (\n \tflag "github.com/spf13/pflag"\n )\n \n+// NotRunnable defines subcommand error\n+var Not... | Go |
51f06c7dd1e73470976107fc6931b21143b83676 | 231 | 2019-08-02 01:25:21+05:00 | 25,200 | ['9334a46bd6b3887f3561d705440038ec93b7f62e'] | Correct all complaints from golint
* i.e.
* go get golang.org/x/lint/golint
* go list ./... | xargs golint | [{'old_path': 'args.go', 'new_path': 'args.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -4,6 +4,7 @@ import (\n \t"fmt"\n )\n \n+// PositionalArgs defines positional arguments callback\n type PositionalArgs func(cmd *Command, args []string) error\n \n // Legacy arg validation has the following behaviour:\n'},... | Go |
d85196337cc9d017cd24c1b0416eb1494e2aef26 | 231 | 2019-08-02 01:25:21+05:00 | 25,200 | ['51f06c7dd1e73470976107fc6931b21143b83676'] | Correct all complaints from goimports
* i.e.
* go get golang.org/x/tools/cmd/goimports
* goimports -w *.go
* goimports -w cobra/ | [{'old_path': 'cobra/cmd/init.go', 'new_path': 'cobra/cmd/init.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -15,10 +15,11 @@ package cmd\n \n import (\n \t"fmt"\n-\t"github.com/spf13/cobra"\n-\t"github.com/spf13/viper"\n \t"os"\n \t"path"\n+\n+\t"github.com/spf13/cobra"\n+\t"github.com/spf13/viper"\n )\n \n v... | Go |
993cc5372a05240dfd59e3ba952748b36b2cd117 | 231 | 2019-08-02 01:25:21+05:00 | 25,200 | ['d85196337cc9d017cd24c1b0416eb1494e2aef26'] | Adjustments per PR review feedback from @bogem | [{'old_path': 'args.go', 'new_path': 'args.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -4,7 +4,6 @@ import (\n \t"fmt"\n )\n \n-// PositionalArgs defines positional arguments callback\n type PositionalArgs func(cmd *Command, args []string) error\n \n // Legacy arg validation has the following behaviour:\n'},... | Go |
b80588d523ec50c7fee20218426cf2ff70920f06 | 24 | 2019-08-05 09:56:17-06:00 | -7,200 | ['993cc5372a05240dfd59e3ba952748b36b2cd117'] | fix undefined cfgFile in documentation (#924) | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -218,6 +218,8 @@ import (\n "github.com/spf13/viper"\n )\n \n+var cfgFile string\n+\n func init() {\n cobra.OnInitialize(initConfig)\n rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (def... | Go |
4f2877d4122ad6a2632aa2bd3edfb103a3130a18 | 41 | 2019-09-16 20:08:40-06:00 | -7,200 | ['b80588d523ec50c7fee20218426cf2ff70920f06'] | clean(travis): remove shellcheck from before_install (#947) | [{'old_path': '.travis.yml', 'new_path': '.travis.yml', 'type': <ModificationType.MODIFY: 5>, 'diff': "@@ -18,13 +18,10 @@ matrix:\n go: 1.12.x\n script: diff -u <(echo -n) <(gofmt -d -s .)\n \n-before_install:\n- - mkdir -p bin\n- - curl -Lso bin/shellcheck https://github.com/caarlos0/shellcheck-docker/r... | Go |
606aa5792c27e9e4404c19c211c4ae8200ee84ef | 499 | 2019-09-16 20:17:19-06:00 | -7,200 | ['4f2877d4122ad6a2632aa2bd3edfb103a3130a18'] | Used goimports to fix import order (#912)
Keeps the list sorted and prevents future merge conflicts. | [] | Go |
19cf35ea77e5981f8e8b90a897af621f2be864f6 | 41 | 2019-09-17 09:02:42-06:00 | -7,200 | ['606aa5792c27e9e4404c19c211c4ae8200ee84ef'] | fix: ensure that testproject is removed even after a failure (#948)
* fix: ensure that testproject is removed even after a failure
* fix: defer licenseFile
* style: simply defer os.RemoveAll
* cobra/cmd: add getProject test func | [{'old_path': 'cobra/cmd/add_test.go', 'new_path': 'cobra/cmd/add_test.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -7,31 +7,14 @@ import (\n )\n \n func TestGoldenAddCmd(t *testing.T) {\n-\n-\twd, _ := os.Getwd()\n \tcommand := &Command{\n \t\tCmdName: "test",\n \t\tCmdParent: parentName,\n-\t\tProject: &P... | Go |
3745fcd26232890015d35e0398b59e26f0a85130 | 397 | 2019-10-03 15:53:10-06:00 | 21,600 | ['19cf35ea77e5981f8e8b90a897af621f2be864f6'] | add goreportcard to readme (#971) | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -30,6 +30,7 @@ etc.\n [](https://travis-ci.org/spf13/cobra)\n [ | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -210,33 +210,52 @@ You will additionally define flags and handle configuration in your init() funct\n For example cmd/root.go:\n \n ```go\n+package cmd\n+\n import (\n \t"fmt"\n- "os"\n \n \thomedir "github.com/mitche... | Go |
c022f6fabd6ec400cb7227be78bc651d9423be35 | 29 | 2019-10-07 15:41:51-06:00 | 25,200 | ['48e6ac4718b3f139d3bb28ace54986ca6889d1ca'] | Update README.md (#944)
I think it meant to be `Echo` here instead of `Print` since the command is called `cmdEcho`. | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -482,7 +482,7 @@ For many years people have printed back to the screen.`,\n Echo works a lot like print, except it has a child command.`,\n Args: cobra.MinimumNArgs(1),\n Run: func(cmd *cobra.Command, args []st... | Go |
8a4b46fadf756f30eff047abf2f8edba4eac6fef | 41 | 2019-10-13 21:11:37-06:00 | -7,200 | ['c022f6fabd6ec400cb7227be78bc651d9423be35'] | update viper to v1.4.0 (#953) | [{'old_path': 'go.mod', 'new_path': 'go.mod', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -3,11 +3,10 @@ module github.com/spf13/cobra\n go 1.12\n \n require (\n-\tgithub.com/BurntSushi/toml v0.3.1 // indirect\n \tgithub.com/cpuguy83/go-md2man v1.0.10\n \tgithub.com/inconshreveable/mousetrap v1.0.0\n \tgithub.com... | Go |
77e4d5aecc4d34e58f72e5a1c4a5a13ef55e6f44 | 323 | 2019-10-19 16:17:41-06:00 | -39,600 | ['8a4b46fadf756f30eff047abf2f8edba4eac6fef'] | Update md2man to v2.0.0 (#977)
Fixes #805 | [{'old_path': 'doc/man_docs.go', 'new_path': 'doc/man_docs.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -24,7 +24,7 @@ import (\n \t"strings"\n \t"time"\n \n-\t"github.com/cpuguy83/go-md2man/md2man"\n+\t"github.com/cpuguy83/go-md2man/v2/md2man"\n \t"github.com/spf13/cobra"\n \t"github.com/spf13/pflag"\n )\n'}... | Go |
b04b5bfc50cbb6c036d2115ed55ea1bccdaf82a9 | 336 | 2019-12-02 08:04:30-05:00 | -3,600 | ['77e4d5aecc4d34e58f72e5a1c4a5a13ef55e6f44'] | substitute wrong word in md_docs (#998) | [{'old_path': 'doc/md_docs.md', 'new_path': 'doc/md_docs.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -1,6 +1,6 @@\n # Generating Markdown Docs For Your Own cobra.Command\n \n-Generating man pages from a cobra command is incredibly easy. An example is as follows:\n+Generating Markdown pages from a cobra comma... | Go |
447f182a9da843c53fa3dd6acfbd043a857e152e | 399 | 2019-12-23 13:51:40-07:00 | 25,200 | ['0d9d2d46f3099574b6d524c3d8834dd592a80fb3'] | format tpl/main.go templates (#980) | [{'old_path': 'cobra/cmd/testdata/root.go.golden', 'new_path': 'cobra/cmd/testdata/root.go.golden', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -17,18 +17,15 @@ package cmd\n \n import (\n \t"fmt"\n- "os"\n \t"github.com/spf13/cobra"\n+\t"os"\n \n \thomedir "github.com/mitchellh/go-homedir"\n \t"github.com/spf13... | Go |
bf268956645942d536f2faef6d53f1951f9522a4 | 448 | 2019-12-26 10:55:42-07:00 | 18,000 | ['447f182a9da843c53fa3dd6acfbd043a857e152e'] | Fix regression when calling *_custom_func (#1001)
PR #889 introduced a regression where the global variable $c is no
longer set when *custom_func is called. This is because $c is re-used
by mistake in the read loop.
This PR simply changes the name of the variable used in the loop.
Signed-off-by: Marc Khouzam ... | [{'old_path': 'bash_completions.go', 'new_path': 'bash_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -61,6 +61,7 @@ __%[1]s_contains_word()\n __%[1]s_handle_reply()\n {\n __%[1]s_debug "${FUNCNAME[0]}"\n+ local comp\n case $cur in\n -*)\n if [[ $(type -t compopt) = "b... | Go |
89c7ffb5129bebd58cd68878c13af2144a5791f3 | 147 | 2020-01-06 11:10:57-07:00 | 21,600 | ['bf268956645942d536f2faef6d53f1951f9522a4'] | Bump year on golden files (#1010) | [{'old_path': 'cobra/cmd/testdata/main.go.golden', 'new_path': 'cobra/cmd/testdata/main.go.golden', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -1,5 +1,5 @@\n /*\n-Copyright © 2019 NAME HERE <EMAIL ADDRESS>\n+Copyright © 2020 NAME HERE <EMAIL ADDRESS>\n \n Licensed under the Apache License, Version 2.0 (the "Lice... | Go |
21cab29ef902d36da074e8c940437c9f536b2283 | 190 | 2020-02-19 11:20:06-05:00 | 0 | ['89c7ffb5129bebd58cd68878c13af2144a5791f3'] | fix: undefined er (#1039) | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -214,6 +214,7 @@ package cmd\n \n import (\n \t"fmt"\n+\t"os"\n \n \thomedir "github.com/mitchellh/go-homedir"\n \t"github.com/spf13/cobra"\n@@ -255,6 +256,11 @@ func init() {\n \trootCmd.AddCommand(initCmd)\n }\n \n+f... | Go |
3c2624538b7d0935103b37a9313661ffaad30d46 | 262 | 2020-02-20 11:42:29-07:00 | 21,600 | ['0da06874266c88228b8f14615396a1f6bfc90ed7'] | Correct documentation for InOrStdin (#929)
Documentation on function is incorrect | [{'old_path': 'command.go', 'new_path': 'command.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -309,7 +309,7 @@ func (c *Command) ErrOrStderr() io.Writer {\n \treturn c.getErr(os.Stderr)\n }\n \n-// InOrStdin returns output to stderr\n+// InOrStdin returns input to stdin\n func (c *Command) InOrStdin() io.Read... | Go |
39cf99f556817dc31535a3fbc8a60c7fbd70ba56 | 397 | 2020-02-20 12:25:38-07:00 | 25,200 | ['3c2624538b7d0935103b37a9313661ffaad30d46'] | leverage makefile to run build tasks (#976)
remove circle ci | [{'old_path': '.circleci/config.yml', 'new_path': None, 'type': <ModificationType.DELETE: 4>, 'diff': '@@ -1,53 +0,0 @@\n-version: 2\n-\n-references:\n- workspace: &workspace\n- /go/src/github.com/spf13/cobra\n-\n- run_tests: &run_tests\n- run:\n- name: "All Commands"\n- command: |\n- mkdir -p ... | Go |
95f2f73ed97e57387762620175ccdc277a8597a0 | 276 | 2020-02-28 11:13:40-07:00 | 18,000 | ['39cf99f556817dc31535a3fbc8a60c7fbd70ba56'] | Add short version flag -v when not otherwise set (#996)
Signed-off-by: Dave Henderson <dhenderson@gmail.com> | [{'old_path': 'command.go', 'new_path': 'command.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -84,7 +84,8 @@ type Command struct {\n \n \t// Version defines the version for this command. If this value is non-empty and the command does not\n \t// define a "version" flag, a "version" boolean flag will be added ... | Go |
6607e6b8603f56adb027298ee6695e06ffb3a819 | 397 | 2020-03-27 14:38:32-06:00 | 21,600 | ['95f2f73ed97e57387762620175ccdc277a8597a0'] | Partial Revert of #922 (#1068)
Issue Reference: https://github.com/spf13/cobra/issues/1056
https://github.com/spf13/cobra/pull/922 introduced a new error
type that emitted when a command was not runnable. This caused
all commands w/o a run function set to error w/ that message and a status code of 1.
This chan... | [{'old_path': 'command.go', 'new_path': 'command.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -18,7 +18,6 @@ package cobra\n import (\n \t"bytes"\n \t"context"\n-\t"errors"\n \t"fmt"\n \t"io"\n \t"os"\n@@ -29,8 +28,6 @@ import (\n \tflag "github.com/spf13/pflag"\n )\n \n-var ErrSubCommandRequired = errors.New... | Go |
f62883520e343a2f99f0326b04b7bf9a41dc0d98 | 145 | 2020-04-01 10:25:22-06:00 | -32,400 | ['6607e6b8603f56adb027298ee6695e06ffb3a819'] | Replace deprecated SetOutput func with SetOut and SetErr in test (#1053) | [{'old_path': 'cobra/cmd/golden_test.go', 'new_path': 'cobra/cmd/golden_test.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -13,8 +13,10 @@ var update = flag.Bool("update", false, "update .golden files")\n \n func init() {\n \t// Mute commands.\n-\taddCmd.SetOutput(new(bytes.Buffer))\n-\tinitCmd.SetOutput(new(b... | Go |
bbffa3aa944332b9d9f642d5fa0a551dc8b3abb5 | 397 | 2020-04-01 10:27:47-06:00 | 21,600 | ['f62883520e343a2f99f0326b04b7bf9a41dc0d98'] | rm circle ci badge (#1073) | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -28,7 +28,6 @@ Many of the most widely used Go projects are built using Cobra, such as:\n etc.\n \n [](https://travis-ci.org/spf13/cobra)\n-[![Ci... | Go |
d88d9a09e9c65d0974864d85e7af363feb2a86b3 | 663 | 2020-04-02 09:26:08-06:00 | 14,400 | ['bbffa3aa944332b9d9f642d5fa0a551dc8b3abb5'] | Add Labeler Actions (#1074)
* adds labels to PRs
this will label PRs such that
the maintainers have visibility into
the breadth of the changes being suggested
* Create labeler.yml
* add all shell completions to labeler
any changes to and autocomplete for any shell
will now be auto labelled as impactin... | [{'old_path': None, 'new_path': '.github/labeler.yml', 'type': <ModificationType.ADD: 1>, 'diff': '@@ -0,0 +1,12 @@\n+# changes to documentation\n+"area/documentation": doc/**/*\n+\n+# changes to the core lib package\n+"area/lib": ./*.go\n+\n+# changes to the zsh completion\n+"area/*sh completion":\n+ - ./zsh_*\n+ - ... | Go |
138b98f39dedc35ae01b827fb9bceacaf30b0880 | 663 | 2020-04-02 10:55:31-06:00 | 14,400 | ['d88d9a09e9c65d0974864d85e7af363feb2a86b3'] | add support for autolabel stale PR (#1075)
* add support for autolabel stale PR
automatically labels stale PRs
* stale label is kind/stale
updates the stale label to reflect
existing project labels
* adds a relevant stale message
for both PRs and issues there is now a more
descriptive and relevant mes... | [{'old_path': None, 'new_path': '.github/workflows/stale.yml', 'type': <ModificationType.ADD: 1>, 'diff': '@@ -0,0 +1,21 @@\n+name: Mark stale issues and pull requests\n+\n+on:\n+ schedule:\n+ - cron: "0 0 * * *"\n+\n+jobs:\n+ stale:\n+\n+ runs-on: ubuntu-latest\n+\n+ steps:\n+ - uses: actions/stale@v1\n+ ... | Go |
b80aeb17fc46362ff9cea51437a719322f8965ac | 449 | 2020-04-03 13:43:43-06:00 | 14,400 | ['138b98f39dedc35ae01b827fb9bceacaf30b0880'] | Add support for custom completions in Go (#1035)
This commit allows programs using Cobra to code their custom completions
in Go instead of Bash.
The new ValidArgsFunction field is added for commands, similarly to
ValidArgs. For flags, the new function
Command.RegisterFlagCompletionFunc() is added.
When eithe... | [{'old_path': 'bash_completions.go', 'new_path': 'bash_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -58,6 +58,67 @@ __%[1]s_contains_word()\n return 1\n }\n \n+__%[1]s_handle_go_custom_completion()\n+{\n+ __%[1]s_debug "${FUNCNAME[0]}: cur is ${cur}, words[*] is ${words[*]}, #words[@] is ${... | Go |
b84ef40338051c81c2916fe90c7e73e6e5583182 | 449 | 2020-04-06 11:28:44-06:00 | 14,400 | ['b80aeb17fc46362ff9cea51437a719322f8965ac'] | Rename BashCompDirectives to ShellCompDirectives (#1082)
Since the completion directives will be used for all shells, and that
these names will be consumed by users, this is a more appropriate name.
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca> | [{'old_path': 'bash_completions.go', 'new_path': 'bash_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -344,7 +344,7 @@ __%[1]s_handle_word()\n __%[1]s_handle_word\n }\n \n-`, name, CompRequestCmd, BashCompDirectiveError, BashCompDirectiveNoSpace, BashCompDirectiveNoFileComp))\n+`, name, ShellCom... | Go |
47414285f9d9c47e163ee6777b024c3d8fb71dcb | 406 | 2020-04-06 11:30:17-06:00 | -7,200 | ['b84ef40338051c81c2916fe90c7e73e6e5583182'] | Add Github CLI to list of projects using Cobra (#1034) | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -25,6 +25,7 @@ Many of the most widely used Go projects are built using Cobra, such as:\n [mattermost-server](https://github.com/mattermost/mattermost-server),\n [Gardener](https://github.com/gardener/gardenctl),\n [Li... | Go |
7fead4bf3b209fb6e08df01188a7dbc2ac3103bf | 401 | 2020-04-06 11:36:04-06:00 | 21,600 | ['47414285f9d9c47e163ee6777b024c3d8fb71dcb'] | Remove/replace SetOutput on Command - deprecated (#1078)
Replace SetOutput on Command - deprecated | [{'old_path': 'command_test.go', 'new_path': 'command_test.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -1814,7 +1814,8 @@ func (tc *calledAsTestcase) test(t *testing.T) {\n \tparent.SetArgs(tc.args)\n \n \toutput := new(bytes.Buffer)\n-\tparent.SetOutput(output)\n+\tparent.SetOut(output)\n+\tparent.SetErr(ou... | Go |
a684a6d7f5e37385d954dd3b5a14fc6912c6ab9d | 449 | 2020-04-10 13:56:28-06:00 | 14,400 | ['7fead4bf3b209fb6e08df01188a7dbc2ac3103bf'] | Fish completion using Go completion (#1048)
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca> | [{'old_path': 'args.go', 'new_path': 'args.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -2,6 +2,7 @@ package cobra\n \n import (\n \t"fmt"\n+\t"strings"\n )\n \n type PositionalArgs func(cmd *Command, args []string) error\n@@ -34,8 +35,15 @@ func NoArgs(cmd *Command, args []string) error {\n // OnlyValidArgs ... | Go |
8c638d3f9077b692f7d12a212a74be98326d11a2 | 226 | 2020-04-10 15:30:10-06:00 | -10,800 | ['a684a6d7f5e37385d954dd3b5a14fc6912c6ab9d'] | Fixed typo. (#1087)
Changed 'applicaton' to 'application'. | [{'old_path': 'cobra/cmd/init.go', 'new_path': 'cobra/cmd/init.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -67,7 +67,7 @@ Init will not use an existing directory with contents.`,\n \t\t\t\ter(err)\n \t\t\t}\n \n-\t\t\tfmt.Printf("Your Cobra applicaton is ready at\\n%s\\n", project.AbsolutePath)\n+\t\t\tfmt.P... | Go |
090d94f4743e6590e11c154c45ccbca01a6eaf9a | 654 | 2020-04-16 11:00:24-06:00 | 21,600 | ['8c638d3f9077b692f7d12a212a74be98326d11a2'] | Move projects using Cobra (#1090)
Since there are so many projects using Cobra, we created a separate
document to list them | [{'old_path': 'README.md', 'new_path': 'README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -2,31 +2,9 @@\n \n Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files.\n \n-Many of the most widely used Go projects are built using Co... | Go |
11ba63fc3bc37818c471fc7912783e6909da4645 | 449 | 2020-04-25 09:03:04-06:00 | 14,400 | ['090d94f4743e6590e11c154c45ccbca01a6eaf9a'] | Add Helm as project using Cobra (#1103)
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca> | [{'old_path': 'projects_using_cobra.md', 'new_path': 'projects_using_cobra.md', 'type': <ModificationType.MODIFY: 5>, 'diff': "@@ -8,6 +8,7 @@\n - [Giant Swarm's gsctl](https://github.com/giantswarm/gsctl)\n - [Github CLI](https://github.com/cli/cli)\n - [GopherJS](http://www.gopherjs.org/)\n+- [Helm](https://helm.sh)\... | Go |
44d55fb4d308b9ee64b7b189421730595300339a | 654 | 2020-04-28 11:49:46-06:00 | 21,600 | ['11ba63fc3bc37818c471fc7912783e6909da4645'] | Fix cobra command README (#1106)
Describes the behavior of custom LICENSE generation using properties in
~/.cobra.yml | [{'old_path': 'cobra/README.md', 'new_path': 'cobra/README.md', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -88,12 +88,17 @@ author: Steve Francia <spf@spf13.com>\n license: MIT\n ```\n \n+You can also use built-in licenses. For example, **GPLv2**, **GPLv3**, **LGPL**,\n+**AGPL**, **MIT**, **2-Clause BSD** or **3... | Go |
41fd44e1df83ad6acd8e14b304d5f2a2ae1d62f5 | 654 | 2020-04-28 16:59:18-06:00 | 21,600 | ['44d55fb4d308b9ee64b7b189421730595300339a'] | Fix cobra init cmd help documentation (#1108)
Adds tests for other cases where we do not expect projects to be created
for absolute paths and relative paths in GOPATH. | [{'old_path': 'cobra/cmd/init.go', 'new_path': 'cobra/cmd/init.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -32,20 +32,30 @@ var (\n \t\tLong: `Initialize (cobra init) will create a new application, with a license\n and the appropriate structure for a Cobra-based CLI application.\n \n- * If a name is provide... | Go |
e392f3204db0445f1f4ad47448b04d8c8ad04c2a | 385 | 2020-04-29 11:15:55-06:00 | 21,600 | ['41fd44e1df83ad6acd8e14b304d5f2a2ae1d62f5'] | Man pages won't have auto gen tag when option is disabled (#1104)
* Man pages wont have auto gen tag when option is disabled
- this addresses #741
* Add documentation for doc generation and a changelog | [{'old_path': None, 'new_path': 'CHANGELOG.md', 'type': <ModificationType.ADD: 1>, 'diff': '@@ -0,0 +1,22 @@\n+# Cobra Changelog\n+\n+## Pending\n+* Fix man page doc generation - no auto generated tag when `cmd.DisableAutoGenTag = true` @jpmcb\n+\n+## v1.0.0\n+Announcing v1.0.0 of Cobra. 🎉\n+**Notable Changes**\n+* Fi... | Go |
f8fdd173832c65ef5c7d97a8bccb32f1ba567038 | 449 | 2020-05-07 15:04:14-06:00 | 14,400 | ['e392f3204db0445f1f4ad47448b04d8c8ad04c2a'] | Complete command names even if ValidArgs present (#1088)
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca> | [{'old_path': 'bash_completions.go', 'new_path': 'bash_completions.go', 'type': <ModificationType.MODIFY: 5>, 'diff': '@@ -181,10 +181,9 @@ __%[1]s_handle_reply()\n local completions\n completions=("${commands[@]}")\n if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then\n- completions=("${must_have_one_nou... | Go |