From 3fc91a70b41ccf25a43930ba11f1cc1cfaed4b73 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 7 May 2015 20:58:15 -0700 Subject: [PATCH] core/commands/publish: Fix published message Previously we had a confusing situation, with: * single-arg doc: published name to * double-arg doc: published name to * implementation: Published name to Now we have the uniform: Published to --- core/commands/name.go | 12 ++++++------ core/commands/publish.go | 9 +++++---- test/sharness/t0100-name.sh | 6 +++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/core/commands/name.go b/core/commands/name.go index 7f263083d18..ee3632055ec 100644 --- a/core/commands/name.go +++ b/core/commands/name.go @@ -27,15 +27,15 @@ and resolve, the default value of is your own identity public key. Examples: -Publish a to your identity name: +Publish an 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 to another public key: +Publish an 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: diff --git a/core/commands/publish.go b/core/commands/publish.go index c784bbcd245..d9c938ed40e 100644 --- a/core/commands/publish.go +++ b/core/commands/publish.go @@ -35,12 +35,13 @@ Examples: Publish an to your identity name: > ipfs name publish /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy - published name QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n to QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + Published /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n Publish an 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 + `, }, @@ -102,7 +103,7 @@ Publish an 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 }, }, diff --git a/test/sharness/t0100-name.sh b/test/sharness/t0100-name.sh index 495323393cb..7053a308e82 100755 --- a/test/sharness/t0100-name.sh +++ b/test/sharness/t0100-name.sh @@ -14,11 +14,11 @@ test_init_ipfs test_expect_success "'ipfs name publish' succeeds" ' PEERID=`ipfs id --format=""` && - 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 ' @@ -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 '