From e4447b3c961eb874d50476957236102335feca9b 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 : With the following goals: 1. It's clear that we're writing to 's IPNS slot in the DHT. 2. We preserve the order of arguments from the command-line invocation: $ ipfs name publish 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..eba937304fe 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 to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy -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 to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy Resolve the value of your identity: diff --git a/core/commands/publish.go b/core/commands/publish.go index c784bbcd245..2f52bf3560d 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 to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy 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 to QmbCMUZw6JFeZ7Wp9jkzbye3Fzp2GGcPgC3nmeUjfVF87n: /ipfs/QmatmE9msSfkKxoffpHwNLNKgwZG8eT9Bud6YoPab52vpy + `, }, @@ -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 to %s: %s\n", v.Name, v.Value) return strings.NewReader(s), nil }, }, diff --git a/test/sharness/t0100-name.sh b/test/sharness/t0100-name.sh index 495323393cb..531eddf9dd9 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 to ${PEERID}: /ipfs/$HASH_WELCOME_DOCS" >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 to ${PEERID}: /ipfs/$HASH_WELCOME_DOCS/help" >expected3 && test_cmp publish_out expected3 '