mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-06 08:20:57 +08:00
core/commands/unixfs: Rename 'ipfs unixfs' to 'ipfs file'
To be less confusing to newcomers (the IPFS filesystem isn't Unix-specific anyway, and it isn't even very POSIX-specific [1,2,3]). I'm a bit uncertain about having one name for users and another for devs, but the consensus seems to be that mainaining two names is worth the trouble [4]. We also kicked around: * 'files' (plural), * 'filesystem' (too long), and * 'fs' (redundant after 'ipfs', even though IPFS isn't just about filesystems) on IRC [5 through 6]. I wish there was a more evocative term. I'm never sure where "file" lands on the scale between "filesysytem", "everything is a file", "a single chunk of data with an associated inode". But we can't think of anything better. [1]: https://github.com/ipfs/go-ipfs/pull/1348#issuecomment-110529070 [2]: https://github.com/ipfs/go-ipfs/pull/1348#issuecomment-110529921 [3]: https://github.com/ipfs/go-ipfs/pull/1136/files#r29377283 In my response to this (no longer visibile on GitHub): On Wed, Apr 29, 2015 at 01:30:04PM -0700, Juan Batiz-Benet wrote: > > +package fsnode > > i think this package should be called `unixfs` as that's the > abstraction that this is calling to. Will do, although I don't see what's especially Unix-y about these file nodes. [4]: https://github.com/ipfs/go-ipfs/pull/1348#issuecomment-110529811 [5]: https://botbot.me/freenode/ipfs/2015-06-09/?msg=41428456&page=5 [6]: https://botbot.me/freenode/ipfs/2015-06-09/?msg=41430703&page=5 License: MIT Signed-off-by: W. Trevor King <wking@tremily.us>
This commit is contained in:
@ -36,7 +36,7 @@ DATA STRUCTURE COMMANDS
|
||||
|
||||
block Interact with raw blocks in the datastore
|
||||
object Interact with raw dag nodes
|
||||
unixfs Interact with Unix filesystem objects
|
||||
file Interact with Unix filesystem objects
|
||||
|
||||
ADVANCED COMMANDS
|
||||
|
||||
@ -104,7 +104,7 @@ var rootSubcommands = map[string]*cmds.Command{
|
||||
"stats": StatsCmd,
|
||||
"swarm": SwarmCmd,
|
||||
"tour": tourCmd,
|
||||
"unixfs": unixfs.UnixFSCmd,
|
||||
"file": unixfs.UnixFSCmd,
|
||||
"update": UpdateCmd,
|
||||
"version": VersionCmd,
|
||||
"bitswap": BitswapCmd,
|
||||
|
@ -6,12 +6,12 @@ var UnixFSCmd = &cmds.Command{
|
||||
Helptext: cmds.HelpText{
|
||||
Tagline: "Interact with ipfs objects representing Unix filesystems",
|
||||
ShortDescription: `
|
||||
'ipfs unixfs' provides a familar interface to filesystems represtented
|
||||
'ipfs file' provides a familar interface to filesystems represtented
|
||||
by IPFS objects that hides IPFS-implementation details like layout
|
||||
objects (e.g. fanout and chunking).
|
||||
`,
|
||||
Synopsis: `
|
||||
ipfs unixfs ls <path>... - List directory contents for <path>...
|
||||
ipfs file ls <path>... - List directory contents for <path>...
|
||||
`,
|
||||
},
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
# MIT Licensed; see the LICENSE file in this repository.
|
||||
#
|
||||
|
||||
test_description="Test unixfs ls command"
|
||||
test_description="Test file ls command"
|
||||
|
||||
. lib/test-lib.sh
|
||||
|
||||
@ -38,11 +38,11 @@ test_ls_cmd() {
|
||||
test_cmp expected_add actual_add
|
||||
'
|
||||
|
||||
test_expect_success "'ipfs unixfs ls <three dir hashes>' succeeds" '
|
||||
ipfs unixfs ls QmfNy183bXiRVyrhyWtq3TwHn79yHEkiAGFr18P7YNzESj QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy QmSix55yz8CzWXf5ZVM9vgEvijnEeeXiTSarVtsqiiCJss >actual_ls
|
||||
test_expect_success "'ipfs file ls <three dir hashes>' succeeds" '
|
||||
ipfs file ls QmfNy183bXiRVyrhyWtq3TwHn79yHEkiAGFr18P7YNzESj QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy QmSix55yz8CzWXf5ZVM9vgEvijnEeeXiTSarVtsqiiCJss >actual_ls
|
||||
'
|
||||
|
||||
test_expect_success "'ipfs unixfs ls <three dir hashes>' output looks good" '
|
||||
test_expect_success "'ipfs file ls <three dir hashes>' output looks good" '
|
||||
cat <<-\EOF >expected_ls &&
|
||||
QmfNy183bXiRVyrhyWtq3TwHn79yHEkiAGFr18P7YNzESj:
|
||||
d1
|
||||
@ -61,11 +61,11 @@ test_ls_cmd() {
|
||||
test_cmp expected_ls actual_ls
|
||||
'
|
||||
|
||||
test_expect_success "'ipfs unixfs ls <file hashes>' succeeds" '
|
||||
ipfs unixfs ls /ipfs/QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy/1024 QmQNd6ubRXaNG6Prov8o6vk3bn6eWsj9FxLGrAVDUAGkGe >actual_ls_file
|
||||
test_expect_success "'ipfs file ls <file hashes>' succeeds" '
|
||||
ipfs file ls /ipfs/QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy/1024 QmQNd6ubRXaNG6Prov8o6vk3bn6eWsj9FxLGrAVDUAGkGe >actual_ls_file
|
||||
'
|
||||
|
||||
test_expect_success "'ipfs unixfs ls <file hashes>' output looks good" '
|
||||
test_expect_success "'ipfs file ls <file hashes>' output looks good" '
|
||||
cat <<-\EOF >expected_ls_file &&
|
||||
/ipfs/QmR3jhV4XpxxPjPT3Y8vNnWvWNvakdcT3H6vqpRBsX1MLy/1024
|
||||
QmQNd6ubRXaNG6Prov8o6vk3bn6eWsj9FxLGrAVDUAGkGe
|
||||
|
Reference in New Issue
Block a user