#!/usr/bin/env python

#
#  simple demo for a standalone convenience wrapper
#  around git-annex-initremote for an osf remote
#
#  Expects to be called fom within annex repository
#
#  arg 1: name for the remote
#  arg 2: project ID of existing OSF project
#  arg 3: (optional) path to be used within that project to store
#         annex objects under

import sys
from datalad_osf.utils import initialize_osf_remote


if __name__ == '__main__':

    if sys.argv[1] == "-h" or len(sys.argv) > 4 or len(sys.argv) < 3:
        print("Usage: init-osf-remote <remote-name> <osf-project-id> "
              "[<path-within-project>]")
        sys.exit(0)

    remote = sys.argv[1]
    if not remote:
        raise ValueError("a remote name is required")
    project = sys.argv[2]
    if not project:
        raise ValueError("OSF project ID required")
    if len(sys.argv) == 4:
        objpath = sys.argv[3]
    else:
        objpath = "git-annex"

    initialize_osf_remote(remote=remote, node=project, objpath=objpath)


#!/usr/bin/env python

#
#  simple demo for a standalone convenience script
#  creating an OSF project and appropriately call
#  git-annex-initremote
#
#  Expects to be called fom within annex repository
#
#  arg 1: project title
#  arg 2: remote name
#  arg 3: (optional) path to be used within that project to store
#         annex objects under

import sys
