Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
130c08c3
Commit
130c08c3
authored
May 17, 2016
by
Jakub Sztandera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make format logic look much better
License: MIT Signed-off-by:
Jakub Sztandera
<
kubuxu@protonmail.ch
>
parent
94f1922d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
core/commands/files/files.go
core/commands/files/files.go
+7
-12
No files found.
core/commands/files/files.go
View file @
130c08c3
...
...
@@ -135,24 +135,19 @@ func statGetFormatOptions(req cmds.Request) (string, error) {
hash
,
_
,
_
:=
req
.
Option
(
"hash"
)
.
Bool
()
size
,
_
,
_
:=
req
.
Option
(
"size"
)
.
Bool
()
format
Specified
:=
req
.
Option
(
"format"
)
.
Found
()
format
,
found
,
_
:=
req
.
Option
(
"format"
)
.
String
()
if
moreThanOne
(
hash
,
size
,
fo
rmatSpecifie
d
)
{
if
moreThanOne
(
hash
,
size
,
fo
un
d
)
{
return
""
,
formatError
}
format
:=
""
if
hash
{
format
=
"<hash>"
return
"<hash>"
,
nil
}
else
if
size
{
return
"<cumulsize>"
,
nil
}
else
{
return
format
,
nil
}
if
size
{
format
=
"<cumulsize>"
}
if
len
(
format
)
==
0
{
format
,
_
,
_
=
req
.
Option
(
"format"
)
.
String
()
}
return
format
,
nil
}
func
statNode
(
ds
dag
.
DAGService
,
fsn
mfs
.
FSNode
)
(
*
Object
,
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment