Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
vnotepad
Exa
提交
3d587c45
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,体验更适合开发者的 AI 搜索 >>
提交
3d587c45
编写于
2月 22, 2015
作者:
N
nwin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename attr to xattr
上级
227ddc9a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
23 addition
and
21 deletion
+23
-21
src/file.rs
src/file.rs
+6
-6
src/main.rs
src/main.rs
+1
-1
src/options.rs
src/options.rs
+8
-6
src/output/details.rs
src/output/details.rs
+4
-4
src/xattr/mod.rs
src/xattr/mod.rs
+4
-4
src/xattr/xattr_darwin.rs
src/xattr/xattr_darwin.rs
+0
-0
src/xattr/xattr_other.rs
src/xattr/xattr_other.rs
+0
-0
未找到文件。
src/file.rs
浏览文件 @
3d587c45
...
...
@@ -21,8 +21,8 @@ use column::Column::*;
use
dir
::
Dir
;
use
filetype
::
HasType
;
use
options
::{
SizeFormat
,
TimeType
};
use
attr
;
use
attr
::
Attribute
;
use
x
attr
;
use
x
attr
::
Attribute
;
/// This grey value is directly in between white and black, so it's guaranteed
/// to show up on either backgrounded terminal.
...
...
@@ -41,7 +41,7 @@ pub struct File<'a> {
pub
ext
:
Option
<
String
>
,
pub
path
:
Path
,
pub
stat
:
io
::
FileStat
,
pub
attrs
:
Vec
<
Attribute
>
,
pub
x
attrs
:
Vec
<
Attribute
>
,
pub
this
:
Option
<
Dir
>
,
}
...
...
@@ -83,7 +83,7 @@ impl<'a> File<'a> {
path
:
path
.clone
(),
dir
:
parent
,
stat
:
stat
,
attrs
:
attr
::
llist
(
path
)
.unwrap_or
(
Vec
::
new
()),
xattrs
:
x
attr
::
llist
(
path
)
.unwrap_or
(
Vec
::
new
()),
name
:
filename
.to_string
(),
ext
:
ext
(
filename
.as_slice
()),
this
:
this
,
...
...
@@ -196,7 +196,7 @@ impl<'a> File<'a> {
path
:
target_path
.clone
(),
dir
:
self
.dir
,
stat
:
stat
,
attrs
:
attr
::
list
(
target_path
)
.unwrap_or
(
Vec
::
new
()),
xattrs
:
x
attr
::
list
(
target_path
)
.unwrap_or
(
Vec
::
new
()),
name
:
filename
.to_string
(),
ext
:
ext
(
filename
.as_slice
()),
this
:
None
,
...
...
@@ -351,7 +351,7 @@ impl<'a> File<'a> {
/// attribute or not. Also returns “ ” in case the attributes cannot be read
/// for some reason.
fn
attribute_marker
(
&
self
)
->
ANSIString
{
if
self
.attrs
.len
()
>
0
{
Plain
.paint
(
"@"
)
}
else
{
Plain
.paint
(
" "
)
}
if
self
.
x
attrs
.len
()
>
0
{
Plain
.paint
(
"@"
)
}
else
{
Plain
.paint
(
" "
)
}
}
/// Generate the "rwxrwxrwx" permissions string, like how ls does it.
...
...
src/main.rs
浏览文件 @
3d587c45
...
...
@@ -30,7 +30,7 @@ pub mod filetype;
pub
mod
options
;
pub
mod
output
;
pub
mod
term
;
pub
mod
attr
;
pub
mod
x
attr
;
struct
Exa
<
'a
>
{
count
:
usize
,
...
...
src/options.rs
浏览文件 @
3d587c45
...
...
@@ -4,7 +4,7 @@ use column::Column;
use
column
::
Column
::
*
;
use
output
::{
Grid
,
Details
};
use
term
::
dimensions
;
use
attr
;
use
x
attr
;
use
std
::
ascii
::
AsciiExt
;
use
std
::
cmp
::
Ordering
;
...
...
@@ -45,7 +45,7 @@ impl Options {
/// Call getopts on the given slice of command-line strings.
pub
fn
getopts
(
args
:
&
[
String
])
->
Result
<
(
Options
,
Vec
<
String
>
),
Misfire
>
{
let
mut
opts
=
getopts
::
Options
::
new
();
if
attr
::
feature_implemented
()
{
if
x
attr
::
feature_implemented
()
{
opts
.optflag
(
"@"
,
"extended"
,
"display extended attribute keys and sizes in long (-l) output"
);
...
...
@@ -226,7 +226,7 @@ impl View {
columns
:
try!
(
Columns
::
deduce
(
matches
)),
header
:
matches
.opt_present
(
"header"
),
tree
:
matches
.opt_present
(
"recurse"
),
ext_attr
:
attr
::
feature_implemented
()
&&
matches
.opt_present
(
"extended"
),
xattr
:
x
attr
::
feature_implemented
()
&&
matches
.opt_present
(
"extended"
),
filter
:
filter
,
};
...
...
@@ -257,7 +257,7 @@ impl View {
else
if
matches
.opt_present
(
"tree"
)
{
Err
(
Misfire
::
Useless
(
"tree"
,
false
,
"long"
))
}
else
if
attr
::
feature_implemented
()
&&
matches
.opt_present
(
"extended"
)
{
else
if
x
attr
::
feature_implemented
()
&&
matches
.opt_present
(
"extended"
)
{
Err
(
Misfire
::
Useless
(
"extended"
,
false
,
"long"
))
}
else
if
matches
.opt_present
(
"oneline"
)
{
...
...
@@ -564,8 +564,10 @@ mod test {
#[test]
fn
extended_without_long
()
{
let
opts
=
Options
::
getopts
(
&
[
"--extended"
.to_string
()
]);
assert_eq!
(
opts
.unwrap_err
(),
Misfire
::
Useless
(
"extended"
,
false
,
"long"
))
if
xattr
::
feature_implemented
()
{
let
opts
=
Options
::
getopts
(
&
[
"--extended"
.to_string
()
]);
assert_eq!
(
opts
.unwrap_err
(),
Misfire
::
Useless
(
"extended"
,
false
,
"long"
))
}
}
#[test]
...
...
src/output/details.rs
浏览文件 @
3d587c45
use
column
::{
Alignment
,
Column
,
Cell
};
use
attr
::
Attribute
;
use
x
attr
::
Attribute
;
use
dir
::
Dir
;
use
file
::{
File
,
GREY
};
use
options
::{
Columns
,
FileFilter
};
...
...
@@ -13,7 +13,7 @@ pub struct Details {
pub
columns
:
Columns
,
pub
header
:
bool
,
pub
tree
:
bool
,
pub
ext_
attr
:
bool
,
pub
x
attr
:
bool
,
pub
filter
:
FileFilter
,
}
...
...
@@ -76,7 +76,7 @@ impl Details {
print!
(
"{}
\n
"
,
row
.name
);
if
self
.
ext_
attr
{
if
self
.
x
attr
{
let
width
=
row
.attrs
.iter
()
.map
(|
a
|
a
.name
()
.len
())
.max
()
.unwrap_or
(
0
);
for
attr
in
row
.attrs
.iter
()
{
let
name
=
attr
.name
();
...
...
@@ -97,7 +97,7 @@ impl Details {
cells
:
columns
.iter
()
.map
(|
c
|
file
.display
(
c
,
cache
,
locale
))
.collect
(),
name
:
file
.file_name_view
(),
last
:
index
==
src
.len
()
-
1
,
attrs
:
file
.attrs
.clone
(),
attrs
:
file
.
x
attrs
.clone
(),
children
:
file
.this
.is_some
(),
};
...
...
src/attr/mod.rs
→
src/
x
attr/mod.rs
浏览文件 @
3d587c45
//! Extended attribute support
#[cfg(target_os
=
"macos"
)]
mod
attr_darwin
;
mod
x
attr_darwin
;
#[cfg(target_os
=
"macos"
)]
pub
use
self
::
attr_darwin
::
*
;
pub
use
self
::
x
attr_darwin
::
*
;
#[cfg(not(target_os
=
"macos"
))]
mod
attr_other
;
mod
x
attr_other
;
#[cfg(not(target_os
=
"macos"
))]
pub
use
self
::
attr_other
::
*
;
pub
use
self
::
x
attr_other
::
*
;
src/
attr/
attr_darwin.rs
→
src/
xattr/x
attr_darwin.rs
浏览文件 @
3d587c45
文件已移动
src/
attr/
attr_other.rs
→
src/
xattr/x
attr_other.rs
浏览文件 @
3d587c45
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录