Skip to content

Commit cef57dc

Browse files
committed
cargo: updates from 0.95.0
1 parent b67855c commit cef57dc

File tree

14 files changed

+86
-21
lines changed

14 files changed

+86
-21
lines changed

completers/common/cargo_completer/cmd/bench.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ func init() {
4343
benchCmd.Flags().String("target-dir", "", "Directory for all generated artifacts")
4444
benchCmd.Flags().StringSlice("test", nil, "Benchmark only the specified test target")
4545
benchCmd.Flags().Bool("tests", false, "Benchmark all targets that have `test = true` set")
46-
benchCmd.Flags().String("timings", "", "Timing output formats (unstable) (comma separated): html, json")
46+
benchCmd.Flags().Bool("timings", false, "Output a build timing report at the end of the build")
4747
benchCmd.Flags().Bool("unit-graph", false, "Output build graph in JSON (unstable)")
4848
benchCmd.Flags().Bool("workspace", false, "Benchmark all packages in the workspace")
49-
benchCmd.Flag("timings").NoOptDefVal = " "
5049
rootCmd.AddCommand(benchCmd)
5150

5251
carapace.Gen(benchCmd).FlagCompletion(carapace.ActionMap{

completers/common/cargo_completer/cmd/build.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,9 @@ func init() {
4646
buildCmd.Flags().String("target-dir", "", "Directory for all generated artifacts")
4747
buildCmd.Flags().StringSlice("test", nil, "Build only the specified test target")
4848
buildCmd.Flags().Bool("tests", false, "Build all targets that have `test = true` set")
49-
buildCmd.Flags().String("timings", "", "Timing output formats (unstable) (comma separated): html, json")
49+
buildCmd.Flags().Bool("timings", false, "Output a build timing report at the end of the build")
5050
buildCmd.Flags().Bool("unit-graph", false, "Output build graph in JSON (unstable)")
5151
buildCmd.Flags().Bool("workspace", false, "Build all packages in the workspace")
52-
buildCmd.Flag("timings").NoOptDefVal = " "
5352
rootCmd.AddCommand(buildCmd)
5453

5554
carapace.Gen(buildCmd).FlagCompletion(carapace.ActionMap{

completers/common/cargo_completer/cmd/check.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ func init() {
4444
checkCmd.Flags().String("target-dir", "", "Directory for all generated artifacts")
4545
checkCmd.Flags().StringSlice("test", nil, "Check only the specified test target")
4646
checkCmd.Flags().Bool("tests", false, "Check all targets that have `test = true` set")
47-
checkCmd.Flags().String("timings", "", "Timing output formats (unstable) (comma separated): html, json")
47+
checkCmd.Flags().Bool("timings", false, "Output a build timing report at the end of the build")
4848
checkCmd.Flags().Bool("unit-graph", false, "Output build graph in JSON (unstable)")
4949
checkCmd.Flags().Bool("workspace", false, "Check all packages in the workspace")
50-
checkCmd.Flag("timings").NoOptDefVal = " "
5150
rootCmd.AddCommand(checkCmd)
5251

5352
carapace.Gen(checkCmd).FlagCompletion(carapace.ActionMap{

completers/common/cargo_completer/cmd/doc.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ func init() {
4141
docCmd.Flags().BoolP("release", "r", false, "Build artifacts in release mode, with optimizations")
4242
docCmd.Flags().StringSlice("target", nil, "Build for the target triple")
4343
docCmd.Flags().String("target-dir", "", "Directory for all generated artifacts")
44-
docCmd.Flags().String("timings", "", "Timing output formats (unstable) (comma separated): html, json")
44+
docCmd.Flags().Bool("timings", false, "Output a build timing report at the end of the build")
4545
docCmd.Flags().Bool("unit-graph", false, "Output build graph in JSON (unstable)")
4646
docCmd.Flags().Bool("workspace", false, "Document all packages in the workspace")
47-
docCmd.Flag("timings").NoOptDefVal = " "
4847
rootCmd.AddCommand(docCmd)
4948

5049
carapace.Gen(docCmd).FlagCompletion(carapace.ActionMap{

completers/common/cargo_completer/cmd/fix.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,8 @@ func init() {
4949
fixCmd.Flags().String("target-dir", "", "Directory for all generated artifacts")
5050
fixCmd.Flags().StringSlice("test", nil, "Fix only the specified test target")
5151
fixCmd.Flags().Bool("tests", false, "Fix all targets that have `test = true` set")
52-
fixCmd.Flags().String("timings", "", "Timing output formats (unstable) (comma separated): html, json")
52+
fixCmd.Flags().Bool("timings", false, "Output a build timing report at the end of the build")
5353
fixCmd.Flags().Bool("workspace", false, "Fix all packages in the workspace")
54-
fixCmd.Flag("timings").NoOptDefVal = " "
5554
rootCmd.AddCommand(fixCmd)
5655

5756
carapace.Gen(fixCmd).FlagCompletion(carapace.ActionMap{

completers/common/cargo_completer/cmd/install.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ func init() {
4545
installCmd.Flags().String("tag", "", "Tag to use when installing from git")
4646
installCmd.Flags().StringSlice("target", nil, "Build for the target triple")
4747
installCmd.Flags().String("target-dir", "", "Directory for all generated artifacts")
48-
installCmd.Flags().String("timings", "", "Timing output formats (unstable) (comma separated): html, json")
48+
installCmd.Flags().Bool("timings", false, "Output a build timing report at the end of the build")
4949
installCmd.Flags().String("vers", "", "Specify a version to install")
5050
installCmd.Flags().String("version", "", "Specify a version to install")
51-
installCmd.Flag("timings").NoOptDefVal = " "
5251
installCmd.Flag("vers").Hidden = true
5352
rootCmd.AddCommand(installCmd)
5453

completers/common/cargo_completer/cmd/publish.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ func init() {
3333
publishCmd.Flags().String("registry", "", "Registry to upload the package to")
3434
publishCmd.Flags().StringSlice("target", nil, "Build for the target triple")
3535
publishCmd.Flags().String("target-dir", "", "Directory for all generated artifacts")
36-
publishCmd.Flags().String("token", "", "Token to use when uploading")
3736
publishCmd.Flags().Bool("workspace", false, "Publish all packages in the workspace")
3837
rootCmd.AddCommand(publishCmd)
3938

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var report_rebuildsCmd = &cobra.Command{
9+
Use: "rebuilds",
10+
Short: "Reports rebuild reasons from previous sessions (unstable)",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(report_rebuildsCmd).Standalone()
16+
17+
report_rebuildsCmd.Flags().BoolP("help", "h", false, "Print help")
18+
report_rebuildsCmd.Flags().String("id", "", "Session ID to report on")
19+
report_rebuildsCmd.Flags().String("manifest-path", "", "Path to Cargo.toml")
20+
reportCmd.AddCommand(report_rebuildsCmd)
21+
22+
carapace.Gen(report_rebuildsCmd).FlagCompletion(carapace.ActionMap{
23+
"manifest-path": carapace.ActionDirectories(),
24+
})
25+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var report_sessionsCmd = &cobra.Command{
9+
Use: "sessions",
10+
Short: "Reports the previous sessions (unstable)",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(report_sessionsCmd).Standalone()
16+
17+
report_sessionsCmd.Flags().BoolP("help", "h", false, "Print help")
18+
report_sessionsCmd.Flags().String("limit", "", "Limit the number of results")
19+
report_sessionsCmd.Flags().String("manifest-path", "", "Path to Cargo.toml")
20+
reportCmd.AddCommand(report_sessionsCmd)
21+
22+
carapace.Gen(report_sessionsCmd).FlagCompletion(carapace.ActionMap{
23+
"manifest-path": carapace.ActionDirectories(),
24+
})
25+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package cmd
2+
3+
import (
4+
"github.com/carapace-sh/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var report_timingsCmd = &cobra.Command{
9+
Use: "timings",
10+
Short: "Reports the build timings of previous sessions (unstable)",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(report_timingsCmd).Standalone()
16+
17+
report_timingsCmd.Flags().BoolP("help", "h", false, "Print help")
18+
report_timingsCmd.Flags().String("id", "", "Session ID to report on")
19+
report_timingsCmd.Flags().String("manifest-path", "", "Path to Cargo.toml")
20+
report_timingsCmd.Flags().Bool("open", false, "Opens the timing report in a browser")
21+
reportCmd.AddCommand(report_timingsCmd)
22+
23+
carapace.Gen(report_timingsCmd).FlagCompletion(carapace.ActionMap{
24+
"manifest-path": carapace.ActionDirectories(),
25+
})
26+
}

0 commit comments

Comments
 (0)