This repository was archived by the owner on Aug 30, 2024. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork18
Uh oh!
There was an error while loading.Please reload this page.
Closed
Changes from1 commit
Commits
Show all changes
14 commits Select commitHold shift + click to select a range
ad0f9c9
WIP mirgation to urfave/cli
cmoog659aabc
Migrate secrets to urfave
cmoogb2c08eb
Migrate envs
cmoog8f4a73c
fixup! Migrate envs
cmoogab27899
Rework usage and descriptions
cmoogb693837
fixup! Rework usage and descriptions
cmooge1d9568
fixup! fixup! Rework usage and descriptions
cmoog748409e
More improvements
cmooga27700e
Add `tab:"omit"` struct tag
cmoog66528ca
fixup! Add `tab:"omit"` struct tag
cmoog5c75570
fixup! fixup! Add `tab:"omit"` struct tag
cmoog2cc7d2d
Add table output to envs ls
cmoogbfa54f1
Add json output to envs ls
cmoogb0e06c4
Abstract table writing to xtabwriter
cmoogFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
Add table output to envs ls
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
commit2cc7d2d7411f7b55d8adf7058fa365414b714f9e
There are no files selected for viewing
2 changes: 1 addition & 1 deletionci/integration/integration_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletioncmd/coder/envs.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletionscmd/coder/main.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionscmd/coder/secrets.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletionscmd/coder/users.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
24 changes: 22 additions & 2 deletionsinternal/entclient/env.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletionsinternal/x/xjson/duration.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package xjson | ||
import ( | ||
"encoding/json" | ||
"strconv" | ||
"time" | ||
) | ||
// Duration is a time.Duration that marshals to millisecond precision. | ||
// Most javascript applications expect durations to be in milliseconds. | ||
type Duration time.Duration | ||
// MarshalJSON marshals the duration to millisecond precision. | ||
func (d Duration) MarshalJSON() ([]byte, error) { | ||
du := time.Duration(d) | ||
return json.Marshal(du.Milliseconds()) | ||
} | ||
// UnmarshalJSON unmarshals a millisecond-precision integer to | ||
// a time.Duration. | ||
func (d *Duration) UnmarshalJSON(b []byte) error { | ||
i, err := strconv.ParseInt(string(b), 10, 64) | ||
if err != nil { | ||
return err | ||
} | ||
*d = Duration(time.Duration(i) * time.Millisecond) | ||
return nil | ||
} | ||
func (d Duration) String() string { | ||
return time.Duration(d).String() | ||
} |
2 changes: 1 addition & 1 deletioninternal/x/xtabwriter/tabwriter.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.