Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
vnotepad
Exa
提交
e3a83421
E
Exa
项目概览
vnotepad
/
Exa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
Exa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e3a83421
编写于
12月 24, 2014
作者:
B
Ben S
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Upgrade code and libraries to latest Rust
std::str changes, and the way macros are expanded.
上级
fbdc9c42
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
10 deletion
+16
-10
Cargo.lock
Cargo.lock
+7
-7
src/column.rs
src/column.rs
+8
-2
src/options.rs
src/options.rs
+1
-1
未找到文件。
Cargo.lock
浏览文件 @
e3a83421
...
...
@@ -3,20 +3,20 @@ name = "exa"
version = "0.1.0"
dependencies = [
"ansi_term 0.4.0 (git+https://github.com/ogham/rust-ansi-term.git)",
"natord 1.0.
0
(git+https://github.com/lifthrasiir/rust-natord.git)",
"natord 1.0.
1
(git+https://github.com/lifthrasiir/rust-natord.git)",
"number_prefix 0.2.0 (git+https://github.com/ogham/rust-number-prefix.git)",
"users 0.1.
0
(git+https://github.com/ogham/rust-users.git)",
"users 0.1.
1
(git+https://github.com/ogham/rust-users.git)",
]
[[package]]
name = "ansi_term"
version = "0.4.0"
source = "git+https://github.com/ogham/rust-ansi-term.git#
19b6f71c716ec56fb960c84f3012fb374e8ac1e3
"
source = "git+https://github.com/ogham/rust-ansi-term.git#
7e051531231838dc9431ec099ddf9fe9cc04c558
"
[[package]]
name = "natord"
version = "1.0.
0
"
source = "git+https://github.com/lifthrasiir/rust-natord.git#
83ebf6e7999fe2646bca45d5f6800728a0bbd5c5
"
version = "1.0.
1
"
source = "git+https://github.com/lifthrasiir/rust-natord.git#
fecab8556a4a6675577166bc2c0e269ede1ccc80
"
[[package]]
name = "number_prefix"
...
...
@@ -25,6 +25,6 @@ source = "git+https://github.com/ogham/rust-number-prefix.git#3f690804a3f1704ee9
[[package]]
name = "users"
version = "0.1.
0
"
source = "git+https://github.com/ogham/rust-users.git#
221a1463d3e25acac41615186a1c7fdcf0ad36d7
"
version = "0.1.
1
"
source = "git+https://github.com/ogham/rust-users.git#
c2911ab96a2b2459333029dde3728bfb5847ef04
"
src/column.rs
浏览文件 @
e3a83421
use
std
::
iter
::
repeat
;
pub
enum
Column
{
Permissions
,
FileName
,
...
...
@@ -53,6 +55,10 @@ impl Column {
}
}
fn
spaces
(
length
:
uint
)
->
String
{
repeat
(
" "
)
.take
(
length
)
.collect
()
}
// An Alignment is used to pad a string to a certain length, letting
// it pick which end it puts the text on. It takes the amount of
// padding to apply, rather than the width the text should end up,
...
...
@@ -61,8 +67,8 @@ impl Column {
impl
Alignment
{
pub
fn
pad_string
(
&
self
,
string
:
&
String
,
padding
:
uint
)
->
String
{
match
*
self
{
Alignment
::
Left
=>
format!
(
"{}{}"
,
string
,
" "
.repeat
(
padding
)
.as_slice
()),
Alignment
::
Right
=>
format!
(
"{}{}"
,
" "
.repeat
(
padding
),
string
.as_slice
()),
Alignment
::
Left
=>
format!
(
"{}{}"
,
string
,
spaces
(
padding
)
.as_slice
()),
Alignment
::
Right
=>
format!
(
"{}{}"
,
spaces
(
padding
),
string
.as_slice
()),
}
}
}
...
...
src/options.rs
浏览文件 @
e3a83421
...
...
@@ -72,7 +72,7 @@ impl Options {
};
if
matches
.opt_present
(
"help"
)
{
println!
(
"exa - ls with more features
\n\n
{}"
,
getopts
::
usage
(
"Usage:
\n
exa [options] [files...]"
,
&
opts
))
println!
(
"exa - ls with more features
\n\n
{}"
,
getopts
::
usage
(
"Usage:
\n
exa [options] [files...]"
,
&
opts
))
;
return
Err
(
2
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录