Skip to content

Commit

Permalink
core/commands/publish: Fix published message
Browse files Browse the repository at this point in the history
Previously we had a confusing situation, with:

* single-arg doc: published name <name> to <value>
* double-arg doc: published name <value> to <name>
* implementation: Published name <name> to <value>

Now we have the uniform:

  Published <value> to <name>
  • Loading branch information
wking committed May 8, 2015
1 parent 512332c commit 3d3c787
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
12 changes: 6 additions & 6 deletions core/commands/name.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ and resolve, the default value of <name> is your own identity public key.
Examples:
Publish a <ref> to your identity name:
Publish an <ipfs-path> to your identity name:
> ipfs name publish QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
> ipfs name publish /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Published /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
Publish a <ref> to another public key:
Publish an <ipfs-path> to another public key:
> ipfs name publish QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
> ipfs name publish /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
Published /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
Resolve the value of your identity:
Expand Down
9 changes: 5 additions & 4 deletions core/commands/publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ Examples:
Publish an <ipfs-path> to your identity name:
> ipfs name publish /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
Published /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
Publish an <ipfs-path> to another public key (not implemented):
> ipfs name publish QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy
> ipfs name publish /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
Published /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n
`,
},

Expand Down Expand Up @@ -99,7 +100,7 @@ Publish an <ipfs-path> to another public key (not implemented):
Marshalers: cmds.MarshalerMap{
cmds.Text: func(res cmds.Response) (io.Reader, error) {
v := res.Output().(*IpnsEntry)
s := fmt.Sprintf("Published name %s to %s\n", v.Name, v.Value)
s := fmt.Sprintf("Published %s to %s\n", v.Value, v.Name)
return strings.NewReader(s), nil
},
},
Expand Down
6 changes: 3 additions & 3 deletions test/sharness/t0100-name.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ test_init_ipfs

test_expect_success "'ipfs name publish' succeeds" '
PEERID=`ipfs id --format="<id>"` &&
ipfs name publish "$HASH_WELCOME_DOCS" >publish_out
ipfs name publish "/ipfs/$HASH_WELCOME_DOCS" >publish_out
'

test_expect_success "publish output looks good" '
echo "Published name $PEERID to /ipfs/$HASH_WELCOME_DOCS" >expected1 &&
echo "Published /ipfs/$HASH_WELCOME_DOCS to $PEERID" >expected1 &&
test_cmp publish_out expected1
'

Expand All @@ -39,7 +39,7 @@ test_expect_success "'ipfs name publish' succeeds" '
'

test_expect_success "publish a path looks good" '
echo "Published name $PEERID to /ipfs/$HASH_WELCOME_DOCS/help" >expected3 &&
echo "Published /ipfs/$HASH_WELCOME_DOCS/help to $PEERID" >expected3 &&
test_cmp publish_out expected3
'

Expand Down

0 comments on commit 3d3c787

Please sign in to comment.