Mesg-core: add version command

sample usage:
mesg-core version

sample output:
v0.7 (commit 047d331)

sample output:
dev (commit 433fede)

already exist with:

mesg-core --version

output is:

mesg-core version v0.7.0

That’s good. I’d also like to have the commit hash next to the version, this is specially good for the dev release, this way we can know the exact version in Git system.

Maybe we can create an alias for --version to make it work as a command too like mesg-core version? This seems a bit more convenient to me, easier to guess.

It’s already the case for developer release. Check

    <<: *runOnMachine
      - checkout
      - run: docker build -t mesg/core:dev --build-arg version="dev build `echo $CIRCLE_SHA1 | cut -c1-7`" .
    <<: *runOnDocker
      - checkout
      - run: scripts/ "dev build `echo $CIRCLE_SHA1 | cut -c1-7`"

You can try by downloading a dev release:

I’m not sure we can create alias for this. It’s automatically done by cobra.