{"action":"created","issue":{"url":"https://api.github.com/repos/pubs/pubs/issues/41","labels_url":"https://api.github.com/repos/pubs/pubs/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/pubs/pubs/issues/41/comments","events_url":"https://api.github.com/repos/pubs/pubs/issues/41/events","html_url":"https://github.com/pubs/pubs/issues/41","id":121704174,"number":41,"title":"detach command","user":{"login":"73","id":529346,"avatar_url":"https://avatars.githubusercontent.com/u/529346?v=3","gravatar_id":"","url":"https://api.github.com/users/73","html_url":"https://github.com/73","followers_url":"https://api.github.com/users/73/followers","following_url":"https://api.github.com/users/73/following{/other_user}","gists_url":"https://api.github.com/users/73/gists{/gist_id}","starred_url":"https://api.github.com/users/73/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/73/subscriptions","organizations_url":"https://api.github.com/users/73/orgs","repos_url":"https://api.github.com/users/73/repos","events_url":"https://api.github.com/users/73/events{/privacy}","received_events_url":"https://api.github.com/users/73/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/pubs/pubs/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-12-11T13:01:45Z","updated_at":"2015-12-11T23:37:47Z","closed_at":null,"body":"Hi,\r\nis there a way to `detach` a document after it was attached? I think it doesn't necessarily have to be a command. Something like `pubs attach --remove` would suffice.\r\n-- 73 "},"comment":{"url":"https://api.github.com/repos/pubs/pubs/issues/comments/164079854","html_url":"https://github.com/pubs/pubs/issues/41#issuecomment-164079854","issue_url":"https://api.github.com/repos/pubs/pubs/issues/41","id":164079854,"user":{"login":"omangin","id":1171989,"avatar_url":"https://avatars.githubusercontent.com/u/1171989?v=3","gravatar_id":"","url":"https://api.github.com/users/omangin","html_url":"https://github.com/omangin","followers_url":"https://api.github.com/users/omangin/followers","following_url":"https://api.github.com/users/omangin/following{/other_user}","gists_url":"https://api.github.com/users/omangin/gists{/gist_id}","starred_url":"https://api.github.com/users/omangin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omangin/subscriptions","organizations_url":"https://api.github.com/users/omangin/orgs","repos_url":"https://api.github.com/users/omangin/repos","events_url":"https://api.github.com/users/omangin/events{/privacy}","received_events_url":"https://api.github.com/users/omangin/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T23:37:46Z","updated_at":"2015-12-11T23:37:46Z","body":"I'd say that both can be implemented as aliases… but that not what we want for both.\r\n\r\nFor the command to copy the paper to the current directory I'd say that it definitely falls under alias' use case. Typically `copy = open -w 'cp -t ./'` does it.\r\n\r\nFor removing a document, that definitely needs to be in the core functions. I think the idea of the `doc` subcommand is good, thus replacing `attach`. It seems to be the path taken for the `note` subcommand too. Actually this also makes `open` quite misplaced. It should rather be `doc open`. Or `doc` as well as `note` could default to open. Then shortcuts such as `attach = doc add` or `open = doc open` can be defined in the config for those who wants.\r\n\r\nThe only thing here is that by doing so we chose a path of `pubs [obj] [cmd]` where `[obj]` would relate to the document or the notes and `[cmd]` to open, add, remove, etc. Some argument declarations and options will then be shared by the various primary commands (e.g. the `open --with`). The other path would have been to go for `pubs [cmd] [obj]`. This is closer to the `edit` command with switches for bibtex and meta files.\r\n\r\nAlthough I have no certainty on the question, a nice logic would be (also the closest to what we currently have):\r\n- top level commands for the whole paper (i.e. mandatory meta and bibtex file). Examples are `add`, `remove`, `edit`.\r\n- subcommands for document, notes (actually this one is close to belong to plugins).\r\n- for the `open` command It makes more sense to nest it under `doc`. Whether we need an open command for bibtex files is another story (nice for scripting but could be hacked from export. Also we may not be in favor of exposing too much the bibtex files that are essential parts of the repository. But this is kind of the philosophy of pubs too. In conclusion, let's save this one for later!)\r\n\r\nI think we should favor the logic. Aliases can always be defined to save some keystrokes.\r\n\r\nSorry for the long comment."}}