Skip to content

Commit 55dfffa

Browse files
committed
Changes to tablewriter exposed
1 parent 4e3cdf6 commit 55dfffa

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

cmd/api/bitwarden.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import (
1919
// TYPES
2020

2121
type bwCipher struct {
22-
Name string
23-
Username string
24-
URI string
25-
Folder string
22+
Name string `json:"name,wrap"`
23+
Username string `json:"username,width:30"`
24+
URI string `json:"uri,width:40"`
25+
Folder string `json:"folder,width:36"`
2626
}
2727

2828
///////////////////////////////////////////////////////////////////////////////

cmd/api/flags.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ func (flags *Flags) Parse(args []string) error {
9090
}
9191

9292
// Parse the commands
93-
for _, cmd := range flags.cmds {
94-
if err := cmd.Parse(flags, opts...); err != nil {
95-
fmt.Fprintf(os.Stderr, "%v: %v\n", cmd.Name, err)
96-
return err
93+
if flags.NArg() > 0 {
94+
if cmd := flags.GetCommandSet(flags.Arg(0)); cmd != nil {
95+
if err := cmd.Parse(flags, opts...); err != nil {
96+
fmt.Fprintf(os.Stderr, "%v: %v\n", cmd.Name, err)
97+
return err
98+
}
9799
}
98100
}
99101

pkg/bitwarden/schema/folder.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ import (
1212
type Folders []*Folder
1313

1414
type Folder struct {
15-
Id string `json:"id"`
15+
Id string `json:"id,width:36"`
1616
Name string `json:"name"` // Encrypted
17-
RevisionDate time.Time `json:"revisionDate"`
18-
Object string `json:"object"`
17+
RevisionDate time.Time `json:"revisionDate,width:29"`
18+
Object string `json:"object,width:6"`
1919
}
2020

2121
///////////////////////////////////////////////////////////////////////////////

pkg/bitwarden/schema/kdf.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ package schema
44
// TYPES
55

66
type Kdf struct {
7-
Type int `json:"kdf"`
8-
Iterations int `json:"KdfIterations"`
7+
Type int `json:"kdf,right"`
8+
Iterations int `json:"KdfIterations,right"`
99
}

pkg/bitwarden/schema/profile.go

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,20 @@ import (
99
// TYPES
1010

1111
type Profile struct {
12-
Id string `json:"id"`
12+
Id string `json:"id,width:36"`
1313
Name string `json:"name"`
1414
Email string `json:"email"`
15-
EmailVerified bool `json:"emailVerified"`
16-
Key string `json:"key"`
17-
Premium bool `json:"premium"`
18-
PremiumFromOrganization bool `json:"premiumFromOrganization"`
19-
MasterPasswordHash string `json:"masterPasswordHash"`
20-
MasterPasswordHint *string `json:"masterPasswordHint,omitempty"`
21-
Culture string `json:"culture"`
22-
TwoFactorEnabled bool `json:"twoFactorEnabled"`
23-
SecurityStamp *string `json:"securityStamp,omitempty"`
24-
ForcePasswordReset bool `json:"forcePasswordReset"`
25-
UsesKeyConnector bool `json:"usesKeyConnector"`
15+
EmailVerified bool `json:"emailVerified,width:5,right"`
16+
Key string `json:"key,wrap"`
17+
Premium bool `json:"premium,width:5,right"`
18+
PremiumFromOrganization bool `json:"premiumFromOrganization,width:5,right"`
19+
Culture string `json:"culture,width:5,right"`
20+
TwoFactorEnabled bool `json:"twoFactorEnabled,width:5,right"`
21+
SecurityStamp *string `json:"securityStamp,omitempty,width:5,right"`
22+
ForcePasswordReset bool `json:"forcePasswordReset,width:5,right"`
23+
UsesKeyConnector bool `json:"usesKeyConnector,width:5,right"`
2624
Organizations []*Organization `json:"organizations,omitempty"`
27-
Object string `json:"object"`
25+
Object string `json:"object,width:7,right"`
2826
}
2927

3028
///////////////////////////////////////////////////////////////////////////////

pkg/bitwarden/schema/session.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import (
2020
// Session represents a long-running session with the Bitwarden server
2121
type Session struct {
2222
// Device identifier
23-
Device *Device `json:"device,omitempty"`
23+
Device *Device `json:"device,omitempty,wrap"`
2424

2525
// Login Token
26-
Token *Token `json:"token,omitempty"`
26+
Token *Token `json:"token,omitempty,wrap"`
2727

2828
// Encryption parameters
2929
Kdf

0 commit comments

Comments
 (0)